D347HxD
D347HxD

Reputation: 465

Compile error: method or data member not found

When I try to compile, I have been getting this error saying "Method or data member not found".

This is the code:

Set db = CurrentDb
Set rec = db.OpenRecordset("Select * from SuppliersT")

rec.AddNew
rec("SupplierName") = Me.SupplierAddNameTxt
rec("Address") = Me.SupplierAddAddressTxt
rec("City") = Me.SupplierAddCityTxt
rec("ProvinceState") = Me.SupplierAddProvinceStateTxt
rec("PostalZip") = Me.SupplierAddPostalZipTxt
rec("Phone") = Me.SupplierAddPhoneTxt
rec("Fax") = Me.SupplierAddFaxTxt
rec("Email") = Me.SupplierAddEmailTxt
rec("Notes") = Me.SupplierAddNotesTxT
rec.Update

It highlights the Me.SupplierAddNameTxt in

rec("SupplierName") = Me.SupplierAddNameTxt

I have a textbox named SupplierAddNameTxt on the form the button is located on, and that's why I am trying to set that up to. Not sure why it's doing this. Help would be much appreciated!

Upvotes: 1

Views: 3320

Answers (1)

jacouh
jacouh

Reputation: 8741

I created a form frmTest, added the control SupplierAddNameTxt, with your code, there is no compiling error.

So please check orthograph of the word SupplierAddNameTxt of the control name on the form.

You might type SupplierAddNameTxt in caption instead of the property name.

Upvotes: 1

Related Questions