1

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!

4
  • Is this code placed in the private module of the form, say frmAddSuppliers ? Commented Nov 4, 2013 at 13:33
  • Private Sub MenuDatabaseBtn_Click() It is placed in the onclick event of a button, named MenuDatabseBtn. Commented Nov 4, 2013 at 13:36
  • Is it a compiling error or runtime one? Commented Nov 4, 2013 at 13:43
  • It is a compiling error. Commented Nov 4, 2013 at 13:44

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.