Hide Focus with Control Error

HD20

Registered User.
Local time
Today, 17:41
Joined
Jun 25, 2002
Messages
27
I have read the threads on this subject and I thought I had my coding fixed, but obviously not, beacause I still get the error, "You can't hide a control that has the focus". Maybe it is a form/subform thing.

Here is my code:

Private Sub txtAge_AfterUpdate()
If Me.txtAge > 39 Then
Me!subfrmVersion.Form.chkWellness.Visible = False
End If
End Sub


txtAge is on the main form and chkWellness is on the subform.

Any help would be appreciated.
 
The syntax for referencing a subform is
Code:
Form!MainForm!Subform.Form.ControlName

so for your database it would be

Code:
Form!NameOfMainForm!subfrmVersion.Form.chkWellness.Visible = False

HTH
 
Now I am getting the error, "Microsoft can't find the field 'frmData' referred to in your expression.

frmData is my Main Form.

This is my syntax:
Form!frmData!subfrmVersion.Form.chkWellness.Visible = False

Did I misunderstand your reply and put it in wrong?
 

Users who are viewing this thread

Back
Top Bottom