Dear Programmers!!
Here is code to insert record into table. But i neither get any error message nor record is inserted into table. Please help me out. I'm very new to Access Database Development so need your kind guidance.
Private Sub Form_Click()
Dim dbs As Database
' Modify this line to include the path to Northwind
' on your computer.
Set dbs = OpenDatabase("C:\database\Ali Video Store.mdb")
' Create a new record in the Employees table. The
' first name is Harry, the last name is Washington,
' and the job title is Trainee.
dbs.Execute " INSERT INTO TransMaster "(tm_Customer,tm_DateOut,tm_Employee,tm_MovieID ) VALUES ('9', #02/02/2009#, '2', '2');"
dbs.Close
End Sub
tm_Customer, tm_Employee,tm_MovieID are integer variables. TransMaster has primary key tm_Number which is autonumber field.
Please solve my problem!!
Here is code to insert record into table. But i neither get any error message nor record is inserted into table. Please help me out. I'm very new to Access Database Development so need your kind guidance.
Private Sub Form_Click()
Dim dbs As Database
' Modify this line to include the path to Northwind
' on your computer.
Set dbs = OpenDatabase("C:\database\Ali Video Store.mdb")
' Create a new record in the Employees table. The
' first name is Harry, the last name is Washington,
' and the job title is Trainee.
dbs.Execute " INSERT INTO TransMaster "(tm_Customer,tm_DateOut,tm_Employee,tm_MovieID ) VALUES ('9', #02/02/2009#, '2', '2');"
dbs.Close
End Sub
tm_Customer, tm_Employee,tm_MovieID are integer variables. TransMaster has primary key tm_Number which is autonumber field.
Please solve my problem!!