Adding Empty record

I have a form with a linked subform - the tables have the same fields. The main form contains the daily records and the subform contains the history records.
I have a button does 3 things:
1: takes the daily record in the main form using an append query using the acct# and Plan Year fields and appends it to the history table \ subform.
2: Updates the daily table to put in "" in all the fields excep acct# and Plan year.
3: Refresh the main form \ subform.

Here is the code I am using: (Pretty basic stuff)

DoCmd.SetWarnings False
DoCmd.Hourglass True
DoCmd.OpenQuery "Append OEK to OEK Orders"
DoCmd.OpenQuery "Update OEK after Append OEK Orders"
Forms![Open Enrollment Kits].Refresh
DoCmd.SetWarnings True
DoCmd.Hourglass False

-However the first time I hit the button
it puts a blank record in the subform\history table
and does not do any of the above items
- If i hit the button a second time it then works.

What am i missing in the code or form setups?
Stephen RoesnerAnalysisAsked:
Who is Participating?
 
Stephen RoesnerAnalysisAuthor Commented:
i will try that but doubt it gives much info
0
 
peter57rCommented:
I suggest you comment out the set warnings commands and look at the messages you get , to see if they appear to be correct.
0
 
Jeffrey CoachmanMIS LiasonCommented:
For me, I am confused by this design...
Why the need to do go trough all of this?
This is not the normal way a "history" system is set up...
0
 
Stephen RoesnerAnalysisAuthor Commented:
not really given a solution
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.