Method or Data member not found... yet intellisense says it's there??

MackMan

Registered User.
Local time
Today, 23:40
Joined
Nov 25, 2014
Messages
174
Hi Guys...

I've hit a wall in regards to the Error, Method or data member not found. yet when I wrote the code, intellisense saw it, I added it , and all was well.

image attached.

What I want to happen, is click a button , btnsplit in this instance, and pass some piped open args to another form...

Code:
Private Sub btnSplit_Click()
Me.Dirty = False
Me.cboCategorySelect.value = "Split"
Me.cboSubCategorySelect.value = "Multiple Categories"
Me.ExpenseGroupID.Value = Me.cboSubCategorySelect.Column(1)
 DoCmd.OpenForm "frmBILLS_SplitENTER", acNormal, , , acFormAdd, , Me.BillDetailTopLineID & "|" & Me.TransDate & "|" & [COLOR=darkred]Me.txtAmount[/COLOR] & "|" & Me.txtCallingForm & "|" & Me.PayeeID & "|" & Me.AccountID
End Sub
me.txtamount is where the error is occurring.
the odd thing is, if I play around with the openargs, and move me.txtamount to the last open args (moving it last in the receiving form too) the error then occurs at me.txtcallingform.

I've never experienced this error before, so it's a new one on me.

I've decompiled the database from run.
I've deleted the control on the form and put it back.
I've rewritten the code from scratch.
yet it still appears..

am I right in thinking the form is corrupt and needs redoing?

As always, appreciate your help.
 

Attachments

  • vba.jpg
    vba.jpg
    30.7 KB · Views: 107
assuming textamount is a control name then probably me!textamount

if it's null, then that may be the problem.

nz(me.textamount,0)

alternatively - the me.dot syntax may refer to fields in the source query rather than a control of the same name, but sometimes using it in that way fails. Not sure why. I tend to put any control I want to use on the form.
 
Hi Dave. Many thanks for your reply.

I have an if statement checking if it's blank and I've tried using the Bang in place of the dot. renamed the control, and just about everyting else.

I think I'll redo the form and see what happens. The same code runs perfectly in another database I'm running I just found out.

Having a look on the net (although none suggests intellisence can see the field) it seems there's an occasional bug in Access on this. I found it on this occasion. :mad:
Many thanks for your help! appreciated!
 
alternatively - the me.dot syntax may refer to fields in the source query rather than a control of the same name, but sometimes using it in that way fails. Not sure why. I tend to put any control I want to use on the form.

BobLarson used to say this frequently but I have never seen it happen. I am sure he has seen a lot more of Access than me.

Either way it is shorthand for the real reference. The bang is closer to it because it indicates the default collection. The dot is automatically reinterpreted unless it is before a Property so I guess has more potential to go wrong.

However in my experience Access reliably follows the defaults whether the dot or bang is used.

The default sequence for Me.somename is:
Me.Controls.controlname then Me.Recordset.Fields.fieldname
 
MackMan,

Access at times will highlight a variable saying its undefined, but it's really the variable next to it.

Wayne
 
By my own admission, I should check my spelling. Wayne, absolutely right, it was the pipe next to it, with an incorrectly spelt name.

A new error experienced, and a new one never repeated.

Many thanks for you help guys.

Totally appreciated.
 

Users who are viewing this thread

Back
Top Bottom