By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,934 Members | 1,538 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,934 IT Pros & Developers. It's quick & easy.

Moving from one form to another and then back

P: n/a
I'm sure there is an easy solution for this problem. On "FORM A" is a
combobox with a separate table as its record source. If the data
required in the combobox is not one of the available choices in the
underlying recod source, the user is prompted to "click" a button
opening "FORM B" allowing them to add the necessary data to the
combobox's underlying recordset. Is there a way when closing FORM B and
returning to FORM A to requery the combobox on FORM A so the data that
was just added to the underlying recordset is now one of the available
choices in the combobox?

Thanks
Scott

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
sc******************@gmail.com wrote:
I'm sure there is an easy solution for this problem. On "FORM A" is a
combobox with a separate table as its record source. If the data
required in the combobox is not one of the available choices in the
underlying recod source, the user is prompted to "click" a button
opening "FORM B" allowing them to add the necessary data to the
combobox's underlying recordset. Is there a way when closing FORM B
and returning to FORM A to requery the combobox on FORM A so the data
that was just added to the underlying recordset is now one of the
available choices in the combobox?

Thanks
Scott


Open FormB with the acDialog option then add a requery in the next line of
code.

DoCmd.OpenForm "FormB",,,,,acDialog
Me.ComboBoxName.Requery

The acDialog option will cause the code to pause after the OpenForm method
and will not execute the last line until FormB has been closed.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

P: n/a
Excellent! I knew it was something simple. Thanks for your help.

Scott

Nov 13 '05 #3

P: n/a
Sure; this is a very common setup. In the On Close property of formB, put
some code like:

Forms!formA!myCombo.Requery

This assumes that formA will always be open. If not, add error checking to
handle cases when it is not.
Your combobox on formA will now show the record you just added on formB.
-Ed
<sc******************@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
I'm sure there is an easy solution for this problem. On "FORM A" is a
combobox with a separate table as its record source. If the data
required in the combobox is not one of the available choices in the
underlying recod source, the user is prompted to "click" a button
opening "FORM B" allowing them to add the necessary data to the
combobox's underlying recordset. Is there a way when closing FORM B and
returning to FORM A to requery the combobox on FORM A so the data that
was just added to the underlying recordset is now one of the available
choices in the combobox?

Thanks
Scott

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.