Solved

command

Posted on 1999-01-23
7
228 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
Technology Partners: 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

752 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