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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requery from a popup form

Status
Not open for further replies.

primagic

IS-IT--Management
Jul 24, 2008
476
GB
I am sure I have had this working before on other databases with the code I use.

I have a form frmMainMenu, which opens up a popup form to enter information into.

On the popup form they can create a record which populates another table other than the recordsouce to that popup using vba code.

There is a listbox on the frmMainMenu which pulls information from the table they are updating on the popup form howver when I use the code on the close event of the popup form or the command button on the popup form that adds this record I get the error message,

cant find the field 'RecordList' referred to in your expression. I know for definate that the list box is called 'RecordList'

My code to requery this listbox from the popup:
Code:
Forms!frmMainMenu!RecordList.Requery

My code to open the popup from the frmMainMenu
Code:
DoCmd.OpenForm "frmAddNewClient", , , , , acDialog
Me.Requery

The form properties for the popup form are popup = true, modal = false
 

Try performing the update before the close statement. Once you issue the DoCmd.Close statement the form unloads even though the code will finish running.

Put the
Code:
Forms!frmMainMenu!RecordList.Requery
in the event that closes the form, before the DoCmd.Close.

 
How are ya primagic . . .

Requery doesn't work for listbox. Try:
Code:
[blue]Forms!frmMainMenu!RecordList.RowSource = Forms!frmMainMenu!RecordList.RowSource[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top