Updating form1 with new info from form2

G

Guest

I have two forms: form1 (AddRideData) and form2(AddNewRoute). Form1 opens
ready to add new record to the table Statistics. In that table there is a
field named Route#. Form1 has a combo box that lists Route# and
ShortDesciption from the Route table. If the user selects 0 (zero) from the
combo box it opens form2 in the add new record mode. What I need is help on
the logic (and where to put variables) to update the recordset on form1 with
the new number being created in form2. Right now when form2 opens, I add one
number to the max number in the Route table which creates the new route
number in the Route table and it works. Right now, when I return to Form1,
the Route# 0 is updated to the new value. I just want the current record
(based on the date) to have the new Route# in the tables record.
Thanks
 
S

Steve Schapel

Wylie,

Do you mean that the Combobox on Form1 is bound to the Route# field in
the Statistics table? And do you mean that Form1 remains open while you
add a new Route via Form2? If so, I don't quite follow "the Route# 0 is
updated to the new value"... How does this happen? Is there already
code, for example on the Not In List event of the combobox, which does
stuff. If so, it is likely to only aply to the current record on Form1.
I would imagine that you would need code to Requery the combobox
somewhere along the line, possibly the After Update event of Form2.

By the way, as an aside, it is not a good idea to use a # as part of the
name of a field or control.
 

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