etjohnson81
Programmer
Hello...
I am using the following code to insert a record, the variables are filling ok, but no records get inserted.
I am using the following code to insert a record, the variables are filling ok, but no records get inserted.
Code:
Dim db As DAO.Database
Dim strUsername As String
Dim strSerial As String
Dim intTech As Integer
strUsername = Forms!frmcomputerassign!cboUsername.Column(1)
strSerial = Forms!frmcomputerassign!cboSerial.Column(0)
intTech = Forms!frmcomputerassign!cboTech.Column(1)
Set db = DBEngine(0)(0)
db.Execute "INSERT INTO dbo_tblComputerAssignmentHistory (txtUsername,numAssignedBy,dDateAssigned,txtSerial) VALUES ('" & strUsername & "'," & intTech & "," & Date & ", '" & strSerial & "' )"
msgbox db.RecordsAffected & " computer assigned."
Set db = Nothing