If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
repost - Can I post a record Automatically? Help!
Thanks for replying. More details:
The data entry form has 5 text boxes that fill 5 fields in my Transactions table Ref - Numeric Date - Short Date Supplier - Text Project - Text Value - numeric I have set each of the text boxes in my form frmAutoTransactionEntry to the following default values: Ref - 99 Date - =date() Supplier - TEST Project - AA0000 (which is a test project) Value - 0 There is a button which closes the form (and which normally would post the record to the table)This is the only code on the form: Private Sub CloseButton_Click() On Error GoTo Err_Command_Click Me.Refresh If Me.Dirty Then Me.Dirty = False End If DoCmd.Close acForm, "frmAutoTransactionEntry" Exit_Command_Click: Exit Sub Err_Command_Click: msgbox Err.Description Resume Exit_Command_Click End Sub When the form opens the text boxes are populated with the default values, but unless I amend the details in one of the text boxes the record is not posted to the table. I suspect I need to force a change event to happen but I don't know how. I put the me.refresh in to do this but it didn't work. "Douglas J Steele" wrote: Afraid you'll need to give more details than that! What does the data in a transaction look like? Is it possible to simply use an INSERT INTO SQL statement to provide those values? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Heather" wrote in message ... I would like to post a test record each day automatically. The record is to test whether our overnight copy of the tables is working, the overnight copy overwrites the previous days copy and I would like to open the copy database from time to time and check the date of the test transaction. I have a Data Entry form and had hoped that a copy of that form, with default values in each field could be used. I hoped to open the form, close it and have it post the entries to the table. Unfortunately it doesn't post the record unless I amend some of the data in the form. Help! |
#2
|
|||
|
|||
repost - Can I post a record Automatically? Help!
I think the reason your code is not working is because the form is not Dirty
yet. It does not become dirty until some value has changed. Since these are the default values, they have not changed; therefore, no changes have actually been made to dirty the form. My first question is what are you wanting to do? Why would you want to create or update a record with all defalut values? Without knowing your end objective, I don't have an answer. If you will post back with more info, I will see if there is a way to do this. "Heather" wrote: Thanks for replying. More details: The data entry form has 5 text boxes that fill 5 fields in my Transactions table Ref - Numeric Date - Short Date Supplier - Text Project - Text Value - numeric I have set each of the text boxes in my form frmAutoTransactionEntry to the following default values: Ref - 99 Date - =date() Supplier - TEST Project - AA0000 (which is a test project) Value - 0 There is a button which closes the form (and which normally would post the record to the table)This is the only code on the form: Private Sub CloseButton_Click() On Error GoTo Err_Command_Click Me.Refresh If Me.Dirty Then Me.Dirty = False End If DoCmd.Close acForm, "frmAutoTransactionEntry" Exit_Command_Click: Exit Sub Err_Command_Click: msgbox Err.Description Resume Exit_Command_Click End Sub When the form opens the text boxes are populated with the default values, but unless I amend the details in one of the text boxes the record is not posted to the table. I suspect I need to force a change event to happen but I don't know how. I put the me.refresh in to do this but it didn't work. "Douglas J Steele" wrote: Afraid you'll need to give more details than that! What does the data in a transaction look like? Is it possible to simply use an INSERT INTO SQL statement to provide those values? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Heather" wrote in message ... I would like to post a test record each day automatically. The record is to test whether our overnight copy of the tables is working, the overnight copy overwrites the previous days copy and I would like to open the copy database from time to time and check the date of the test transaction. I have a Data Entry form and had hoped that a copy of that form, with default values in each field could be used. I hoped to open the form, close it and have it post the entries to the table. Unfortunately it doesn't post the record unless I amend some of the data in the form. Help! |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Next Record If, problems with merging multiple records | [email protected] | Mailmerge | 0 | January 13th, 2006 04:38 PM |
Access Mail Merge to Word.doc files ? | RNUSZ@OKDPS | Setting Up & Running Reports | 1 | May 18th, 2005 06:31 PM |
Automatically create record in subform | dk | General Discussion | 2 | September 17th, 2004 03:37 AM |
Form Doesn't Go To New Record | Steve | New Users | 15 | May 16th, 2004 04:33 PM |