P
Phil Hood
Hi,
I'm trying to create some code that will check the name of
a control on a form. I want to include a wildcard in the
check. There are a set of controls on the form named:
1A, 2A, 3A, 4A, 5A
I select each of the controls in turn and then test as
follows:
If Me.Name = *A Then do something....
but it resulted in a message saying 'Compile error,
Expected: expression'
I thought the problem was because I hadn't enclosed *A in
quotes as follows (because the name of a control is a
string):
If Me.Name = "*A" Then do something....
This complied OK but when I run the code it does
not 'find' the control and trigger the 'then' statement.
Any ideas?
Phil.
I'm trying to create some code that will check the name of
a control on a form. I want to include a wildcard in the
check. There are a set of controls on the form named:
1A, 2A, 3A, 4A, 5A
I select each of the controls in turn and then test as
follows:
If Me.Name = *A Then do something....
but it resulted in a message saying 'Compile error,
Expected: expression'
I thought the problem was because I hadn't enclosed *A in
quotes as follows (because the name of a control is a
string):
If Me.Name = "*A" Then do something....
This complied OK but when I run the code it does
not 'find' the control and trigger the 'then' statement.
Any ideas?
Phil.