Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-08-11 : 08:08:52
|
Todd writes "Okay,The project I am working on is in Access 2003 in XP Pro,I am writing most of the actual program in the VBA code editor and using Access for the GUI essentially.I have a form that is generating Invoices the form loads then the user selects the Customer from a combo box and add the date of the Invoice. At this point the Build Invoice Button should be clicked. This button should add a new entry into the OrderInfo table. Then I wish to allow the user to select the product from a combo box add a quanity field, then hit the add to invoice button. This button should add the entry to the OrderDetails table. This is the basic idea behind the whole form. However, I am unable to do any entry adding to the table. Currenty here is how my first button code looks:----->Dim AccountNo As StringDim DateOrder As DateAccountNo = BillTo.Value (A combo box on the form) DateOrder = InvoiceDate.Value(A text box on the form)DoCmd.RunSQL "INSERT INTO OrderInfo (AccountID,OrderDate) VALUES ('AccountNo','DateOrder')", No<------So far all it does is tell me that it can't append record because of a key violation error.Please Help!!!Todd Engkraf" |
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2005-08-11 : 10:26:12
|
looks like either duplicate values are being inserted...or you are trying to pass through 'character' values into numeric fields.The "VALUES ('AccountNo','DateOrder')" bit looks flawed.(i don't use access myself, but what's there doesn't look right) |
 |
|
|
|
|