Solved

200 extra pts:From 'run' Hello.exe  "My String" passes String in program

Posted on 2004-03-26
4
183 Views
Last Modified: 2010-05-01

200 extra points, I asked it in the wrong topic
http://www.experts-exchange.com/Databases/MS_Access/Q_20932956.html

Is it possible to pass a variable from the command line ('Run' in windows) just by opening it providing a parameter from the command line.

Example:

I have a VB EXE called 'Hello.exe'

using a Short-Cut or user types under 'run'

Hello.exe  "My String"

The program receieves a String to use in code


What data types may you pass.

-JP
0
Comment
Question by:sendtojp
[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
  • 2
  • 2
4 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 50 total points
ID: 10685352
You only have to put this in your code:

msgbox Command()

And then start your program like Hello.exe 'My string'
0
 
LVL 1

Author Comment

by:sendtojp
ID: 10685408
I don't understand here is an a better example.

In Hello.exe contains the following code:

Private Sub Form_Load()

    msgbox  strParameter

End Sub


I goto Start and Run in win XP, and type

hello.exe "This is a Test"


Running this program give a msgbox which says "This is a Test"

Thank You,

-JP
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 10685421
Did you program run with the example you gave ?
Otherwise you'll have to change msgbox  strParameter  to  msgbox Command()
0
 
LVL 1

Author Comment

by:sendtojp
ID: 10685558
Sorry I created a mess, not only did I ask the question under the wrong area, I accidently posted it twice.

I will give  pg_india and Dhaest points on each question  pg_india was first to answer but Dhaest clearified it better.


Only one question remains the data types this supports and can you have multiple variables.

Thank You,

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

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 …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

740 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