Help with Append Query (1 Viewer)

gear

Registered User.
Local time
Yesterday, 18:36
Joined
Mar 10, 2007
Messages
112
I have ‘S_NUM’ field in my Table1. This field assigns sequential numbers to records. Sometimes it needs to be changed to start from a different number. I created a new table (tblAppend) with one field (S_NUM). Then I made an Append Query. I inserted a new number in ‘tblAppend’ and run the ‘qryAppend’ from Query Objects Window, it appends the number I want to Table1(S_NUM).

In order to be helpful to users who don’t know much about Access, I made a form for ‘tblAppend’ with a command button to run the Append query, so that the user only has to type the new starting number and click the button.

This is not working. After typing the new start number in the form and clicking Run Append button is not inserting the new number in Table1. If I close the form, open again and click the button, it inserts the number which means the user has to open the form and click the button twice to get a new starting number.

Have I made a mistake somewhere? Please help. Sample DB attached.
 

Attachments

  • db1.zip
    13.6 KB · Views: 90

MStef

Registered User.
Local time
Today, 02:36
Joined
Oct 28, 2004
Messages
2,251
Try this:
In your code before Run query put this:

Docmd.RunCommand acCmdSaveRecord
I think it must be OK.
 

gear

Registered User.
Local time
Yesterday, 18:36
Joined
Mar 10, 2007
Messages
112
Your code works. Thank you very much.
 

Users who are viewing this thread

Top Bottom