Hi there,
I am trying to add an entry to a table via an Insert into statement. It fails every time and I cant work out why.
My table is called tblActionTracking with structure:
Pkey: ActionNumber - Autonumber, Unique
ActionTypeID - Integer, Indexed - Not Unique
MachineNumber - Text (20). Reqd=No, Zero length = Yes
RecordCreatedOn - Date - Default Value = Now()
RecordCreatedBy - Integer
FileImported - Boolean - Default Value = False
My SQL statement is:
CurrentDb.Execute _
"INSERT INTO tblActionTracking(ActionTypeID, MachineNumber, RecordCreatedBy) VALUES (" & ActionTypeID & ",'" & MachineNumber & "', " & RecordCreatedBy & "", dbFailOnError
It is accessed as a method in a class. I did a debug.print of the data being passed to it and got this:
INSERT INTO tblActionTracking(ActionTypeID, MachineNumber, RecordCreatedBy) VALUES(1,'OEMCOMPUTER ', 122); 128
I pasted it into a qry, removing the 128 at the end and it worked perfectly.
Any ideas.
BTW I'm using Access 97. SR-2, with jet engine release 3.5 SP3.
Thanks in advance. Missy Ed
Looking to exchange ideas and tips on VB and MS Access development as well as office 97 development. Drop me a line: msedbbw@hotmail.com
I am trying to add an entry to a table via an Insert into statement. It fails every time and I cant work out why.
My table is called tblActionTracking with structure:
Pkey: ActionNumber - Autonumber, Unique
ActionTypeID - Integer, Indexed - Not Unique
MachineNumber - Text (20). Reqd=No, Zero length = Yes
RecordCreatedOn - Date - Default Value = Now()
RecordCreatedBy - Integer
FileImported - Boolean - Default Value = False
My SQL statement is:
CurrentDb.Execute _
"INSERT INTO tblActionTracking(ActionTypeID, MachineNumber, RecordCreatedBy) VALUES (" & ActionTypeID & ",'" & MachineNumber & "', " & RecordCreatedBy & "", dbFailOnError
It is accessed as a method in a class. I did a debug.print of the data being passed to it and got this:
INSERT INTO tblActionTracking(ActionTypeID, MachineNumber, RecordCreatedBy) VALUES(1,'OEMCOMPUTER ', 122); 128
I pasted it into a qry, removing the 128 at the end and it worked perfectly.
Any ideas.
BTW I'm using Access 97. SR-2, with jet engine release 3.5 SP3.
Thanks in advance. Missy Ed
Looking to exchange ideas and tips on VB and MS Access development as well as office 97 development. Drop me a line: msedbbw@hotmail.com