form with command buttons to navigate to other form and calc valu

G

Guest

I have a form that I go to to calculate the cartage rate (thinking of adding
command buttons to main form which includes all other info - client id, truck
# - quantity shipped etc.) There are a few different cartage rate forms
depending on what type of shipment, bulk, tank. - fields are different and so
is calculation) one form uses just pickup loc and deliv loc. and the other
one actually calculates the cartage rate based on the mileage and there are a
few more scenerio. The would like to add command buttons to the Main form to
go to other form to calculate the cartage rate - depending on the scenerio.
How do I get the cartage rate from the one form onto the main form????? -
Just set text box value on main form = to what - not sure what command button
they will pick?????

Thanks,
Barb
 
G

Guest

Hi babs,

I would have a "Select" command button on your form that first sets the
value in the main form (if this is being stored somewhere) and then closes
the cartage form.

If the same cartage form is called from multiple locations, you might want
to pass the form name as a parameter so you know which form has been passed
(and hence which form to update). Either way, your code would look something
like this in the On Click event of your "Select" button on the cartage form:

forms!MAINFORM.FIELDNAME = me.CARTAGERATEFIELD
docmd.close acForm, me.name

Where MAINFORM, FIELDNAME and CARTAGERATEFIELD are replaced with the
appropriate field names from your forms.

Hope this helps.

Damian.
 

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

Top