When troubleshooting this on the affected PC I did look at the references to be sure everything was checked that should have been (it was) and there was no indication of anything 'missing'. (I also assumed that if there was a library reference missing, there would have been compilation errors...
Yes, the statement is in the BeforeInsert event of a subform and it works fine on 9 of the 10 PCs running the database.
In fact the database has been running fine in it's current form for 10 months now. It was just when a different (used) PC was brought in that the problem started on that...
Ok, I changed the bang to a dot operator, and got the same error message. To be clear, this is the code I tried:
ss="Me.VisitID = '"& GetSiteID()& Me.VisitNum& "'"
MsgBox ss
Eval (ss)
The msgbox displays: Me.VisitID = 'LVG889'
and then the eval statement gives:
Run-time...
As stated in my previous reply, the error message is:
"Run-time error '2482': Client Database can't find the name 'Me' you entered in the expression."
I added the apostrophies as suggested, and got the same error message - "Run-time error '2482': Client Database can't find the name 'Me' you entered in the expression."
The code now looks like this:
ss="Me!VisitID = '"& GetSiteID()& Me!VisitNum & "'"
msgbox ss...
Ok, I removed the quotes (chr(34)) at the start and end so the message box displays:
Me!VisitID = LVG881
which is the valid statement (with the right side evaluated) I want executed. But the eval statement (directly following the message box) now gives a new error message:
Run-time error...
Thanks for responding.
I inserted the suggested code (minus the extra right paranthesis in the second example, so that it would compile) and ran it. The msgbox displays the statement I'm trying to execute, including the quotation marks around it:
"Me!VisitID = GetSiteID() &...
The VBA statement "Screen.MousePointer = 1" will change the mousepointer to an arrow regardless of the type of control being pointed to. It will stay that way until you change it again, even if you close the form. Use "Screen.MousePointer = 0" to reset to the Access default...
I'm getting "Run-time error '-217417848 (80010108)': Method 'Value' of object '_AccessField' failed" on a simple textbox value assignment.
The VBA statement in question ("Me!VisitID = GetSiteID() & Me!VisitNum") is in the BeforeInsert event of a subform, and the textbox...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.