When I save my purchase order(based on purchase order table) I would like to add a new record to my shipping table. The following code gives me an "Invalid use of Null" error. My shipping table has four fields - ID, MachineID, Ship Date, Complete. ID is an autonumber ID field, and I want shipping date to remain null. The following is my code...Can anyone help me?
Dim db As Database
Dim qdf As QueryDef
Dim rst As Recordset
Dim str As String
Dim txtID As String
txtID = Me!txtID
Set db = CurrentDb
str = "INSERT INTO dbo_Shipping " _
& "(MachineID, Complete) " _
& "VALUES(" & Me.txtID & ",1)"
Set qdf = db.CreateQueryDef("", str)
qdf.Execute
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim db As Database
Dim qdf As QueryDef
Dim rst As Recordset
Dim str As String
Dim txtID As String
txtID = Me!txtID
Set db = CurrentDb
str = "INSERT INTO dbo_Shipping " _
& "(MachineID, Complete) " _
& "VALUES(" & Me.txtID & ",1)"
Set qdf = db.CreateQueryDef("", str)
qdf.Execute
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70