Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

command

Posted on 1999-01-23
7
Medium Priority
?
230 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 100 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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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 …
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…
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

722 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