M
Mac
I would like to declare a "short" variable and assign a "lengthy" value to it
then use the variable in an expression. The intention is to shorten the final
expression by using the "short" variable (X) instead of (Reserving User Name
Control 1) without using the actual "lengthy" control name. The problem is
that I keep getting errors and cannot use the variable as a reference to the
control name properly. Any suggestions?
Example:
Private Function Check_If_IsNULL() As Boolean
Dim X As String
X = "Reserving User Name Control 1"
If IsNULL(X.Value) Then 'This line errors with syntax and object errors
Check_If_IsNULL = False
Else
Check_If_IsNULL = True
End If
EndFunction
P.S. I also had the same problem when trying to pass a table name into a
function as a variable and then use it to open (populate) a recordset for
that table.
Example: myRecordSet.Open strTable, ,adOpenKeySet, adLockBatchOptimistic
I keep getting an error that mentions an invalid SQL statment.
then use the variable in an expression. The intention is to shorten the final
expression by using the "short" variable (X) instead of (Reserving User Name
Control 1) without using the actual "lengthy" control name. The problem is
that I keep getting errors and cannot use the variable as a reference to the
control name properly. Any suggestions?
Example:
Private Function Check_If_IsNULL() As Boolean
Dim X As String
X = "Reserving User Name Control 1"
If IsNULL(X.Value) Then 'This line errors with syntax and object errors
Check_If_IsNULL = False
Else
Check_If_IsNULL = True
End If
EndFunction
P.S. I also had the same problem when trying to pass a table name into a
function as a variable and then use it to open (populate) a recordset for
that table.
Example: myRecordSet.Open strTable, ,adOpenKeySet, adLockBatchOptimistic
I keep getting an error that mentions an invalid SQL statment.