Referring to another form in code.

D

DJW

I have two forms. When one form (frm1) opens, I would like to check the
value of a caption on the second form (frm2). How do I refer to the second
form? I think I'm close, but the code below does not work for me yet.

This is the code on frm1:


Private Sub Form_Open(Cancel As Integer)

'If Forms!frm2.Label19.Caption = "Sell" Then
msgbox "Sell item today!"
End If

End Sub

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top