Solved

Adding Empty record

Posted on 2013-06-24
4
159 Views
Last Modified: 2013-08-05
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
Comment
Question by:Grizbear51
  • 2
4 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 39274069
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39287739
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
 

Accepted Solution

by:
Grizbear51 earned 0 total points
ID: 39370949
i will try that but doubt it gives much info
0
 

Author Closing Comment

by:Grizbear51
ID: 39382110
not really given a solution
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now