Solved

command

Posted on 1999-01-23
7
229 Views
Last Modified: 2010-05-19
i have a command box but i do not know how to set the command to do an action when u click it.
How do u?
0
Comment
Question by:mikejh6
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 4

Expert Comment

by:mcix
ID: 1470331
If you double click the command button, it will open the Form Code Module and place you within the click event.  

You could write some code to bring up a Message Box, like this
Sub Command1_Click()

   MsgBox "Hello World!",VbInformation,"The world's oldest and most over-used demo"

End Sub



0
 
LVL 3

Expert Comment

by:Foyal
ID: 1470332
please...
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 1470333
is mcix comment is exactly what you want?

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:cjwik
ID: 1470334
man, I dont' want to rude, but it is impossible to answer a question like this. You have to let us know a little bit more...
0
 
LVL 1

Expert Comment

by:carlosvs
ID: 1470335
Imposible.. for me sorry....!
0
 
LVL 1

Expert Comment

by:rondeauj
ID: 1470336
VB is an events driven lan. You would put your code in the event you want to fire up. Mcix shows you a prefect example for responding to the click event. You could put code in the mouseover event if you want something to happen when the user moves his/her mouse over the control.
0
 

Accepted Solution

by:
GETTYD earned 50 total points
ID: 1470337
In the programming Environment:

1. create a form (Form1)
2. add a command button (Command1)
3. double-click on Command1
    the following code window will appear:
     
         Private Sub Command1_Click()

         End Sub

4. Add a line of code between the two code lines so the whole sub-routine looks as follows:

         Private Sub Command1_Click()

           MsgBox "Hello World", vbOKOnly

         End Sub


5. press the "F5" key

6. click on the Command1 button

7. a message box should appear

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month4 days, 1 hour left to enroll

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question