Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form overwriting record in table instead of adding record 2

Status
Not open for further replies.

netrusher

Technical User
Feb 13, 2005
952
US
I have a form associated to its own table. One of the
fields on this form EcnNumber is populated using
and OpenArgs statement. The other fields on this form
are yes/no boxes. My issue is as follows.

When I check my yes/no boxes and then close the form
the table is updated correctly. The next time I open
the form and check my yes/no boxes etc and close the
form the first entry in the table is overwritten. I would
like to have a separate record each time I utilize the
forma and not have it overwrite the existing record.
What am I doing wrong?
 
When you open the form, what value are you giving for the AcFormOpenDataMode argument? It should be:
Code:
docmd.OpenForm "MyForm",,,,acFormAdd


 
This is what I have right now for the code when the form
is opened.

Code:
DoCmd.OpenForm "PopupChecklist-01EcnAnalystReleaseDate", acNormal, , , , acFormAdd, Forms!ECNBCNVIPfrm![ECNBCNVIP ID]
 
Where you have ", , , ," ... there should be only three commas.
 
It should be:
Code:
DoCmd.OpenForm "PopupChecklist-01EcnAnalystReleaseDate",acNormal, , ,acFormAdd, ,Forms!ECNBCNVIPfrm![ECNBCNVIP ID]

 
Golom,

This is the code that works. Thanks for your help.

Code:
DoCmd.OpenForm "PopupChecklist-01EcnAnalystReleaseDate", acNormal, , , acFormAdd, , Forms!ECNBCNVIPfrm![ECNBCNVIP ID]
 
Tip: put the cursor inside the OpenForm word in your code and then press the F1 key.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top