Button in Form

  • Thread starter Thread starter bbussoloti
  • Start date Start date
B

bbussoloti

I have a problem,
there´s a form, which is accessable via a single button in a sheet.
In this form there´s another button called GO, so i have:

Private Sub Go_Click()
MsgBox ("button clicked... ")
End Sub

When I click this button in my form, nothing happen... the MsgBox warning
does not shows.

What can be the problem here?
 
Open the VB editor by pressing Alt + F11 and select your form from the
project window. Right click the command button on the form and select view
code.
Then enter the code below.

Private Sub CommandButton1_Click()
MsgBox ("button clicked... ")
End Sub

Re-post if it still don't work.
 
Tks for the answer JLGWhiz, but it still don´t work... i actually renamed my
button "Go" instead of "CommandButton1". I tried what you said just in case,
but no success.

This form i have is accessable via a button NOT in a form. Then, when the
form is open, there´s my Go button, which does not displays the MsgBox... i´m
stuck here.

"JLGWhiz" escreveu:
 
Ok... i´ve made it work.
Instead of writing the code in the (general) session, i right clicked the
button in the form, selected show code, and it opened a new window with my
button´s name where it was that (general)

"bbussoloti" escreveu:
 

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