|
-
Jun 30th, 2006, 02:06 PM
#1
Thread Starter
Hyperactive Member
method/data error?
I am using VBA and I keep getting an error that says I have a Method or Data member not found.
It highlights the .txtAddress1 piece of the following code....
VB Code:
strSQL = "UPDATE tblAccounts SET User_Define_3a = '" & Form_frmBldrResiAddrinGP.txtBuilder & "'" & _
", PHONE1 = '" & Form_frmBldrResiAddrinGP.txtPhone1 & "'" & _
", PHONE2 = '" & Form_frmBldrResiAddrinGP.txtPhone2 & "'" & _
", CUSTNAME = '" & Form_frmBldrResiAddrinGP.txtCustName & "'" & _
", ADDRESS1 = '" & Form_frmBldrResiAddrinGP.txtAddress1 & "'" & _
The previous ones work. I don't get why I am getting the error on the last part. Yes, the "txtAddress1" is spelled correctly. After Form_frmBldrResiAddrinGP I even hit period '.' and manually selected txtAddress1 from the drop down list. The text box is also named correctly on the form as it is showing on the drop list. I don't get what's going on.
-
Jun 30th, 2006, 02:45 PM
#2
Re: method/data error?
try this to see what happens:
comment out that line:
in place of it -
Debug.print Form_frmBldrResiAddrinGP.txtBuilder
Debug.print Form_frmBldrResiAddrinGP.txtPhone1
Debug.print Form_frmBldrResiAddrinGP.txtPhone2
Debug.print Form_frmBldrResiAddrinGP.txtCustName
Debug.print Form_frmBldrResiAddrinGP.txtAddress1
did it work?
try this:
in the form design view.. right click the txtAddress1 then pick Build Event
then Code Builder...
now in the code window.. check the spelling.. select the name and copy it
then switch to the other code and paste it in.. did it work?
the error means that object does NOT exsist....
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jun 30th, 2006, 02:46 PM
#3
Re: method/data error?
can you upload the db? (this is access right?)
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jun 30th, 2006, 02:49 PM
#4
Thread Starter
Hyperactive Member
Re: method/data error?
I figured it out. the coding following the last line with .txtAddress1 was misspelled.
I had Form_frmBldrResiAddrinGP.txtUser_Define_4a instead of .txtSubDivision
What threw me off is that it highlighted the line .txtAddress1 instead of the following line .txtUser_Define_4a
Yay! It fixed...but now another error. It's asking me to enter a parameter when it shouldn't ask for one at all. I'll have to see if I can figure that out.
-
Jun 30th, 2006, 02:51 PM
#5
Re: method/data error?
double check your field names thats 1 big reason to get a param prompt
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jun 30th, 2006, 03:42 PM
#6
Thread Starter
Hyperactive Member
Re: method/data error?
Ya, I kind of figured that out the past 2 weeks. But here's the thing...
Main form has sub form
Second Main form has exact same sub form
However, when I run the report button I get that parameter thing on the second main form.
The only differences is that the second main form has one additional textbox and missing two textboxes that the main has. I checked those 3 out and they're fine. Hate when that parameter thing pops up. Always takes me a long time to pin point it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|