access a variable on another forms ?

  • Thread starter Thread starter zulander
  • Start date Start date
Z

zulander

I am trying to acess a varible on another from

---------Form1-------------------

Private Sub Label353_Click()

DoCmd.OpenForm "BUSearch", , , , acFormEdit, acDialog
Forms("BUSearch").SendBuToSender = Me.Label353
End Sub


---------Form2-------------------
Private Sub Form_Unload(Cancel As Integer)
SendBToSender.Caption = "TEST"
End Sub

For some reason it doesn't seem to work anyone have an idea why ?
thank you
 
SendBuToSender can't be a variable if it has a Caption property. It must be
a command button or label.

You seem to be opening a form called "BUSearch" from a label click event on
Form1, and then set Forms("BUSearch").SendBuToSender's Caption property to
the value held in Me.Label353. Then when a different form (Form2) closes,
you want to set Forms("BUSearch").SendBuToSender's Caption property to
"TEST".

If that's what you're really trying to do, then all you did was forget to
specify the Caption property in Label353_Click().

Forms("BUSearch").SendBuToSender.Caption = Me.Label353

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Back
Top