Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adding Empty record

Posted on 2013-06-24
4
Medium Priority
?
202 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:Stephen Roesner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:
Stephen Roesner earned 0 total points
ID: 39370949
i will try that but doubt it gives much info
0
 

Author Closing Comment

by:Stephen Roesner
ID: 39382110
not really given a solution
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

636 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