C
Charles Kingsley
I have a form called FormA. It is bound to TableA.
In FormA, I want to reference one of the fields in TableA, lets say FieldA.
Nornally I would have a text box control in the form and it's control source
would be FieldA and any code that I would use would reference the text box
control. All is fine and dandy.
This time, I want to do away with the text box and assign the current
record's value for FieldA to a variable.
In one database, I used this syntax in a VB module:
MyVariable= Me.FieldA
It works fine. That is MyVariable is given the value of the current
record's FieldA from the form's bound table, without the need of a text box
control.
I tried using the same syntax in another database but get a "Method or Data
member not found" error. If I use MyVariable= Me!FieldA (replacing the dot
with an exclamation point), it works fine.
Why?
Thanks
In FormA, I want to reference one of the fields in TableA, lets say FieldA.
Nornally I would have a text box control in the form and it's control source
would be FieldA and any code that I would use would reference the text box
control. All is fine and dandy.
This time, I want to do away with the text box and assign the current
record's value for FieldA to a variable.
In one database, I used this syntax in a VB module:
MyVariable= Me.FieldA
It works fine. That is MyVariable is given the value of the current
record's FieldA from the form's bound table, without the need of a text box
control.
I tried using the same syntax in another database but get a "Method or Data
member not found" error. If I use MyVariable= Me!FieldA (replacing the dot
with an exclamation point), it works fine.
Why?
Thanks