G
Guest
This is one of those ‘Why in the world is that . . .’ questions.
I have a macro attached to On_Current on frmLaurieSheet
Macro reads: [txtbuyerfullname] Not Like "none†set value
[Forms]![frmLaurieSheet]![cboAssignBuyer].[Locked] yes
[txtbuyerfullname] Like "none" set value
[Forms]![frmLaurieSheet]![cboAssignBuyer].[Locked] no
I have saved the macro as a module, to get the code, and it reads:
With CodeContextObject
If (Eval("[txtbuyerfullname] Not Like ""none""")) Then
Forms!frmLaurieSheet!cboAssignBuyer.Locked = True
End If
If (.txtBuyerFullName Like "none") Then
Forms!frmLaurieSheet!cboAssignBuyer.Locked = False
End If
End With
If I attach that code instead of the macro I get run time error 2482 can’t
find “txtbuyerfullnameâ€
Txtbuyerfullname is not visible but so what? I don’t see why it would matter
but the default view for this form is datasheet.
Why can a macro see what code cannot?
I have a macro attached to On_Current on frmLaurieSheet
Macro reads: [txtbuyerfullname] Not Like "none†set value
[Forms]![frmLaurieSheet]![cboAssignBuyer].[Locked] yes
[txtbuyerfullname] Like "none" set value
[Forms]![frmLaurieSheet]![cboAssignBuyer].[Locked] no
I have saved the macro as a module, to get the code, and it reads:
With CodeContextObject
If (Eval("[txtbuyerfullname] Not Like ""none""")) Then
Forms!frmLaurieSheet!cboAssignBuyer.Locked = True
End If
If (.txtBuyerFullName Like "none") Then
Forms!frmLaurieSheet!cboAssignBuyer.Locked = False
End If
End With
If I attach that code instead of the macro I get run time error 2482 can’t
find “txtbuyerfullnameâ€
Txtbuyerfullname is not visible but so what? I don’t see why it would matter
but the default view for this form is datasheet.
Why can a macro see what code cannot?