Bonhomme Septheure
Registered User.
- Local time
- Today, 15:18
- Joined
- Apr 27, 2012
- Messages
- 14
Hi
I'm trying to run an "insert into" query as a before update event in a form. The code is the following:
I get a key violation error when this runs. I tried running the same code with actual number values in place of Me![txtProjectEntityID] and the variable y and no key violation occured.
I know that Me![txtProjectEntityID] and the variable y have values because I have message boxes appear before running the sql statement to check for values.
Any ideas? By the way, the table I'm putting a new record into isn't the one the form is based on.
Thanks!
I'm trying to run an "insert into" query as a before update event in a form. The code is the following:
Code:
DoCmd.RunSQL "INSERT INTO tblProjectEntityLocation ( ProjectEntityID, EntityLocationID ) VALUES (" & Me![txtProjectEntityID] & "," & y & ");"
I know that Me![txtProjectEntityID] and the variable y have values because I have message boxes appear before running the sql statement to check for values.
Any ideas? By the way, the table I'm putting a new record into isn't the one the form is based on.
Thanks!