Link to home
Start Free TrialLog in
Avatar of Stephen Roesner
Stephen RoesnerFlag for United States of America

asked on

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?
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

I suggest you comment out the set warnings commands and look at the messages you get , to see if they appear to be correct.
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...
ASKER CERTIFIED SOLUTION
Avatar of Stephen Roesner
Stephen Roesner
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Stephen Roesner

ASKER

not really given a solution