Hi all
I have a simple forms with couple of text boxes, and one commad button and it has the following code : my tabe name is Customer Data
it seems that access doesnt like the line :
Set cusdata = CurrentDb.OpenRecordset("Customer Data")
Private Sub Command12_Click()
Dim cusdata As Recordset
Set cusdata = CurrentDb.OpenRecordset("Customer Data")
cusdata.AddNew
cusdata.Fields("Customer_Last_Name") = Me.custfirstname
cusdata.Fields("Customer_First_Name") = Me.custfirstname
cusdata.Fields("Cus_Address_1") = Me.cusadd1
cusdata.Fields("Cus_Address_2") = Me.cusadd2
cusdata.Fields("Cus_STATUS") = Me.cusstatus
cusdata.Update
MsgBox " Record saved"
End Sub
when I press the command button to save the record ( after filling the text bxes with customer inforamtion). I am getting the above error msg. Run rime error 13 , type mismatch , error indicating there is an issue with the command
Set cusdata = CurrentDb.OpenRecordset("Customer Data")
any help will be much appriciated.
Thanks
I have a simple forms with couple of text boxes, and one commad button and it has the following code : my tabe name is Customer Data
it seems that access doesnt like the line :
Set cusdata = CurrentDb.OpenRecordset("Customer Data")
Private Sub Command12_Click()
Dim cusdata As Recordset
Set cusdata = CurrentDb.OpenRecordset("Customer Data")
cusdata.AddNew
cusdata.Fields("Customer_Last_Name") = Me.custfirstname
cusdata.Fields("Customer_First_Name") = Me.custfirstname
cusdata.Fields("Cus_Address_1") = Me.cusadd1
cusdata.Fields("Cus_Address_2") = Me.cusadd2
cusdata.Fields("Cus_STATUS") = Me.cusstatus
cusdata.Update
MsgBox " Record saved"
End Sub
when I press the command button to save the record ( after filling the text bxes with customer inforamtion). I am getting the above error msg. Run rime error 13 , type mismatch , error indicating there is an issue with the command
Set cusdata = CurrentDb.OpenRecordset("Customer Data")
any help will be much appriciated.
Thanks