At a loss please help

Joshker

New member
Local time
Yesterday, 22:39
Joined
Mar 9, 2005
Messages
7
Problem solved (At a loss please help)

I need to have a query run after the record has been saved and only if it is a new record.
I've tried afterupdate event on the form but it doesn't run the query.
Here is the code I put in the afterupdate event.

I'm at a loss :confused: how ever I'm sure it's pretty simple.

Code:
If MyForm.NewRecord = True Then
    DoCmd.Hourglass True
    DoCmd.SetWarnings False
    DoCmd.OpenQuery "QRY_Q013"
    DoCmd.SetWarnings True
    DoCmd.Hourglass False
End If

Thanks
Joshker
 
Last edited:
In the after update event of the form the record isn't new anymore, it's saved. Try the before update event in stead. And, to refer to controls/properties... on the current form, just use

me.newrecord

Added: Or if the query depends on this record being saved, you could try using a form level boolean which you set to true in the before insert event of the form, test for in the after update event of the form in stead of .newrecord, and set to false after running the query.
 
Last edited:
Thanks for the reply RoyVidar
Yes the query does depend on the record being saved, and thanks to your response every thing is working as it should.

Thanks

Joshker :D
 

Users who are viewing this thread

Back
Top Bottom