Form not recognizing a new record until closed and reopened

Gkirkup

Registered User.
Local time
Today, 12:10
Joined
Mar 6, 2007
Messages
628
I have a form for which the Record Source is a certain table. Then on that form there is a button to display another form, which adds a new record to the same table. Then the new form is closed.
The trouble is, the original form cannot search for the new record, until you close the form and reopen it.
I have tried using Me.Dirty is false, and also a requery of the original form, but nothing works. Only closing the form and reopening it will display the newly added record.
What can I do to make the original form recognize the newly added record?

Robert
 
I'm not even sure why you would need to open another form if both Record Sources are bound to the same table. What's the reasoning behind this design? And how did you requery the form?

1. Create a query based on the table
2. Make the query the record source of both forms
3. On closing the form requery the other form like so:
Code:
Forms![COLOR="Blue"]FormName[/COLOR]!Requery
 
Gizmo:
Are .fsetup and .caption commented out?

Robert
 
I devoted hours of my spare time, late nights fussing around trying to find out what was wrong. For some strange reason the forms load event, open event, any f***ing event you can think of... (I'm having "a vent") is triggered "before" the values are past to the custom properties! How stupid is that!
This made me chuckle! :)
 
there are a couple of things that might work

requery does what it says. requeries the underlying query and puts you back to record 1

refresh does something slightly different. it doesn't find new rows, but refreshes the data for changes in rows that it had already found, and doesn't reposition to record 1. (This won't help your current situation - you do need requery for that)
 

Users who are viewing this thread

Back
Top Bottom