• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

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?
0
Stephen Roesner
Asked:
Stephen Roesner
  • 2
1 Solution
 
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:
i will try that but doubt it gives much info
0
 
Stephen RoesnerAnalysisAuthor Commented:
not really given a solution
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now