Update combo in open form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

I have a F_Main based in T_Records
This form has a cboChooseRec and a comand button to open F_NewRec to add new
record.
Now, I need to close and to open F_Main to update the cboChooseRec.
I would like update this combo with open F_Main.
How is it possible, please?
Thanks in advance.
an
 
Will you be using F_NewRec without F_Main being open? If not, in the Close
event of F_NewRec, you could put this code to refresh the combo box:

Forms!F_Main!cboChooseRec.Requery

However, if F_Main is not open when that code executes, you'll get an error.

Did you realize that you could set the LimitToList property of cboChooseRec
to True, and then put code into its NotInList event to open F_NewRec in
Dialog mode? Opening the form in Dialog mode means that you must close it
before you can continue doing anything with F_Main (just like a message
box). You could set Response = acDataErrAdded in in the NotInList event
right after the call to F_NewRec, and that would automatically refresh the
combo box.
 
Ok, DS.
Thank you for your reply.

In fact F_Main is open and work fine.

Thank you more one time for your explanation.
an
 
Back
Top