Controls on another form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a button, btnZ on FormA that opens another called FormB. Once FormB
is open, I would like to disable the button so it can't be pushed again.

Any suggestion would be appreciated.
 
Hi,
All you have to do is to set the focus to any other control on FormA
before you disable the button:

Private Sub cmdOpenForm2_Click()
Me.txtDate.SetFocus
DoCmd.OpenForm "Form2"

Me.cmdOpenForm2.Enabled = False
End Sub

in the above code I set the focus to the txtDate control, then disable my button
 
Back
Top