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
 

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

Back
Top