Calculated results on an FP form

W

Wayne-I-M

Hi

I have a very simple access query that works out the cost of a holiday.

The questions are:
Name of hotel (there are only 3)
In each hotel there are 4 possible room types - twin, double, triple, quad
(each room type in each hotel is a different cost)

The query simply asks
Which hotel do you want
How many twins do you want
How many doubles do you want
How many tripples do you want
How many quads do you want

Does anyone have a link to a page that gives a step by step guide to how to
get this type of thing on to a FP webform.

EG.
Dropdown - Name of hotel
Dropdown - Room type
Dropdown - How many rooms
Answer - text box

This is my 1st attempt to allow users to input to a form and get a
calculated result. So easy answer would be helpfull

Thank you

I have looked at
http://support.microsoft.com/?scid=kb;en-us;823520&spid=919&sid=229
which does not give enough options - so I though it would be better to use
an access query (stick to what you know).
 
S

Stefan B Rusynko

Not something you can do with webots
You will need a server side script/form that
a) collects the data in a form and sends it to a server side script page
b) looks up in the database the prices associated with the form field values and calculates a result

So in the example you cite, send.asp need to be modified, where it has
<%
x = request("filedname") 'get your form field values
'add code here to open your database and look up costs base on the value above
t = c*n 'calculate costs
%>
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Hi
|
| I have a very simple access query that works out the cost of a holiday.
|
| The questions are:
| Name of hotel (there are only 3)
| In each hotel there are 4 possible room types - twin, double, triple, quad
| (each room type in each hotel is a different cost)
|
| The query simply asks
| Which hotel do you want
| How many twins do you want
| How many doubles do you want
| How many tripples do you want
| How many quads do you want
|
| Does anyone have a link to a page that gives a step by step guide to how to
| get this type of thing on to a FP webform.
|
| EG.
| Dropdown - Name of hotel
| Dropdown - Room type
| Dropdown - How many rooms
| Answer - text box
|
| This is my 1st attempt to allow users to input to a form and get a
| calculated result. So easy answer would be helpfull
|
| Thank you
|
| I have looked at
| http://support.microsoft.com/?scid=kb;en-us;823520&spid=919&sid=229
| which does not give enough options - so I though it would be better to use
| an access query (stick to what you know).
|
|
|
| --
| Wayne
| Manchester, England.
|
 
W

Wayne-I-M

Hi

Thank you for the input. Would it be possible (as there are so few options
to simplify the whole thing like this

Drop down hotel
Which hotel do you want
Hotel A
Hotel B
Hotel C

What type of room do you need
A Twin
B Double
C Triple
D Quad

How many rooms do you need (text box)

Text box
If hotel = A and Room = B = (123*456) * rooms req
If hotel = A and Room = C = (123*789) * rooms req
If hotel = B and Room = D = (123*654) * rooms req
etc
etc
Basically there would be no calculation just a text displayed subject to
Dropdown A and Dropdown B being as defined.

Looking at this there are only a total of 12 values that could be in the
text box (times the number of rooms req) - As only 4 rooms can be booked this
gives a total of 48 possible answers

Just trying to get this although as you say it may not be possible


--
Wayne
Manchester, England.



Stefan B Rusynko said:
Not something you can do with webots
You will need a server side script/form that
a) collects the data in a form and sends it to a server side script page
b) looks up in the database the prices associated with the form field values and calculates a result

So in the example you cite, send.asp need to be modified, where it has
<%
x = request("filedname") 'get your form field values
'add code here to open your database and look up costs base on the value above
t = c*n 'calculate costs
%>
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Hi
|
| I have a very simple access query that works out the cost of a holiday.
|
| The questions are:
| Name of hotel (there are only 3)
| In each hotel there are 4 possible room types - twin, double, triple, quad
| (each room type in each hotel is a different cost)
|
| The query simply asks
| Which hotel do you want
| How many twins do you want
| How many doubles do you want
| How many tripples do you want
| How many quads do you want
|
| Does anyone have a link to a page that gives a step by step guide to how to
| get this type of thing on to a FP webform.
|
| EG.
| Dropdown - Name of hotel
| Dropdown - Room type
| Dropdown - How many rooms
| Answer - text box
|
| This is my 1st attempt to allow users to input to a form and get a
| calculated result. So easy answer would be helpfull
|
| Thank you
|
| I have looked at
| http://support.microsoft.com/?scid=kb;en-us;823520&spid=919&sid=229
| which does not give enough options - so I though it would be better to use
| an access query (stick to what you know).
|
|
|
| --
| Wayne
| Manchester, England.
|
 
W

Wayne-I-M

Another idea (not sure if its possible in FP like access)

As there are so few options I could have something like

if box A = 1 and box B = 1 and box C = 1 Value = 123
if box A = 2 and box B = 1 and box C = 1 Value = 456
if box A = 3 and box B = 1 and box C = 1 Value = 789
if box A = 1 and box B = 2 and box C = 1 Value = 987
if box A = 1 and box B = 3 and box C = 1 Value = 654
if box A = 1 and box B = 4 and box C = 1 Value = 321

etc
etc

It would take a while to write all the options but it "may" work ??
 
S

Stefan B Rusynko

Yes
1) get your hotels (field named "hotel"), value = the base rate for that hotel (say 400, 500, 600)
2) get your room rate (field named "rate"), value = the additional for type of bed (say 0, 50, 75, 100)
3) get your # or rooms *field named "qty"), value = the # of nights (say 1 - 7)

<%
BaseRate = Cdbl(request.form("hotel"))
RoomRate = Cdbl(request.form("rate"))
Rooms = CInt(request.form("qty"))
TotalRate = (BaseRate + RoomRate) * Rooms
%

Note:
All values are required, and the Cdbl allows for non-integer values (450.50)
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Another idea (not sure if its possible in FP like access)
|
| As there are so few options I could have something like
|
| if box A = 1 and box B = 1 and box C = 1 Value = 123
| if box A = 2 and box B = 1 and box C = 1 Value = 456
| if box A = 3 and box B = 1 and box C = 1 Value = 789
| if box A = 1 and box B = 2 and box C = 1 Value = 987
| if box A = 1 and box B = 3 and box C = 1 Value = 654
| if box A = 1 and box B = 4 and box C = 1 Value = 321
|
| etc
| etc
|
| It would take a while to write all the options but it "may" work ??
|
|
| --
| Wayne
| Manchester, England.
|
|
|
| "Stefan B Rusynko" wrote:
|
| > Not something you can do with webots
| > You will need a server side script/form that
| > a) collects the data in a form and sends it to a server side script page
| > b) looks up in the database the prices associated with the form field values and calculates a result
| >
| > So in the example you cite, send.asp need to be modified, where it has
| > <%
| > x = request("filedname") 'get your form field values
| > 'add code here to open your database and look up costs base on the value above
| > t = c*n 'calculate costs
| > %>
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > _____________________________________________
| >
| >
| > | Hi
| > |
| > | I have a very simple access query that works out the cost of a holiday.
| > |
| > | The questions are:
| > | Name of hotel (there are only 3)
| > | In each hotel there are 4 possible room types - twin, double, triple, quad
| > | (each room type in each hotel is a different cost)
| > |
| > | The query simply asks
| > | Which hotel do you want
| > | How many twins do you want
| > | How many doubles do you want
| > | How many tripples do you want
| > | How many quads do you want
| > |
| > | Does anyone have a link to a page that gives a step by step guide to how to
| > | get this type of thing on to a FP webform.
| > |
| > | EG.
| > | Dropdown - Name of hotel
| > | Dropdown - Room type
| > | Dropdown - How many rooms
| > | Answer - text box
| > |
| > | This is my 1st attempt to allow users to input to a form and get a
| > | calculated result. So easy answer would be helpfull
| > |
| > | Thank you
| > |
| > | I have looked at
| > | http://support.microsoft.com/?scid=kb;en-us;823520&spid=919&sid=229
| > | which does not give enough options - so I though it would be better to use
| > | an access query (stick to what you know).
| > |
| > |
| > |
| > | --
| > | Wayne
| > | Manchester, England.
| > |
| >
| >
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top