Reference field on form

abenitez77

Registered User.
Local time
Today, 12:16
Joined
Apr 29, 2010
Messages
141
I had this line
GBL_Tab05ID = Me.Tab05ID

and wanted to change this. I have this on the On Current event and it gives me an error because the data is not in the record source when the form opens. How can I change the me. to the formname? The form gets dynamically created so i have

Dim CurrentForm As String
CurrentForm = Me.Form.Name

then i put

GBL_Tab05ID = Forms(CurrentForm).Form.Tab05ID

but that did not work...what is the correct syntax?
 
CurrentForm would need to be declared as public variable in a standard module if you want to use it from other forms.
 
It's the same form. What is another way of saying Me.Tab05ID ?
 
I would expect this to work:

Forms(CurrentForm).Tab05ID
 
Forms(CurrentForm).Tab05ID does work, the issue was there was no record source. I fixed that.
 
Glad you got it sorted.
 

Users who are viewing this thread

Back
Top Bottom