Me.Refresh Error

M

mcwilsong

Has anyone run into a situation where by adding code such as below to a
checkbox, will present this error when clicking on a button that opens a
subform?

Error: Run-time error '2465'
Microsoft Access can't find 'Field' in expression.

Code:
If me.field1 = 0 then
me.field2 = 0
msgbox "You can't select field2, unless field1 is checked!"
end if
 
R

rowiga

If Field1 or Field2 is on the subform and the checkbox is on the parent form
then Access won't be able to find it. If that's the case you'll have to use:

If (Me!SubformName.Form!Field1 = 0) Then
 
M

mcwilsong

No, both fields are on the main form. But, they are on dfifferent tabs on a
tab control.
 
Top