Solved

command

Posted on 1999-01-23
7
222 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
7 Comments
 
LVL 4

Expert Comment

by:mcix
Comment Utility
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
Comment Utility
please...
0
 
LVL 7

Expert Comment

by:Inteqam
Comment Utility
is mcix comment is exactly what you want?

0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 2

Expert Comment

by:cjwik
Comment Utility
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
Comment Utility
Imposible.. for me sorry....!
0
 
LVL 1

Expert Comment

by:rondeauj
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now