Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show new record without closing/reopening form 2

Status
Not open for further replies.

chrislx

Programmer
Oct 17, 2003
32
0
0
US
There are a combo box and button “Create” on Form_1. Clicking on the button, the Form_2 which is used to create a new record is opened. After a new record is entered, the Form_2 is closed.

Problem: The new record just entered cannot be found in the combo box of Form_1. It will show there only after closing/reopening Form_1

How to make it without closing/reopening the form?

Thanks in advance,

LX
 
Have a look at "Requery" in the Help text ...

You will need to get a line like Me.Requery to run after you return to the Form 1 ... you can probably call that from Form 2 by referencing the object back on Form 1 I think.

Hope this helps [pipe]
 
How are chrislx . . . . .

[blue]thecreator[/blue] is 99% there . . .

Any time the data changes for the records that would be returned by the [blue]RowSource[/blue] of a Combobox, you have to [purple]Requery[/purple] the combobox to see the changes. So, in the [blue]Close Event[/blue] for Form_2, add the following code:
Code:
[blue]Forms![purple]Form_1Name[/purple]![purple]ComboboxName[/purple].Requery[/blue]

cal.gif
See Ya! . . . . . .
 
Hi Guys,

Thanks a lot! It works perfectly.

Lx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top