refer to control on parent form

rodmc

Registered User.
Local time
Today, 13:46
Joined
Apr 15, 2010
Messages
514
Im having a little trouble referring to a control on a parent form as you can see from the code below, in particular the setfocus line

Code:
Private Sub cboPrim_Reason_AfterUpdate()
    If Me.cboPrim_Reason = "Mental Health - Other" Then
        MsgBox "If you select Mental Health - Other then you must add the reason to the Notes field!", vbOKOnly, "Warning!"
        Me.Parent.txtNotes.SetFocus
    End If
    
End Sub

clearly my reference is wrong, can someone correct for me

cheers
 
Clearly? Hrmpf....

For references to items on another form - create a textbox on the same form. Open the property sheet, and in Control Source click the ellipses. Navigate to the desired item (amon Loaded forms) in the expression builder, click paste and OK. Now you have a reference you can paste where you need it.
 
cheers bud!
 

Users who are viewing this thread

Back
Top Bottom