Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command Function

Status
Not open for further replies.

SirTECH

Technical User
Jul 24, 2005
42
CA
I've created a custom logon form for a multi-user database rather than using Access' built-in logon. Before adding the custom logon form, several users used the /user and /pwd switches. So I tried to let them similarly do this by passing the username and password arguments to the custom form by using the /cmd switch.
ACCESS.EXE "CustomForm.mdb" /cmd "users name"
Then I try to get the text using the Command function.
[red]Dim strTEXT as variant
strTEXT = Command()[/red]

But the strTEXT returns a 0.
I tried using the text following the /cmd with and without quotes, but the result is the same.
How can I get text from a command line switch?
 
i don't know what is that /cmd used for?
but i also have created a custom logon form,
what i do is:

-create a table of users with valid passwords
-create a form with user id and password text boxes
-in the logon form deactivate all menu bars and also the f11 key(if you dont know how, i can show you)

in this cases user will not be able to do anything else but typing their user ids and passwords to access the database and it worked for me.
 
According to Microsoft the /cmd is...
Specifies that what follows on the command line is the value that will be returned by the Command function. This option must be the last option on the command line. You can use a semicolon (;) as an alternative to /cmd.

Thanks for the suggestion to deactivated the menu bars and F11 key. I've done that by way of hiding the access window entirely, so the only visible object is my custom form. This seems to work very well. The only reason that I wanted to incorporate the /cmd switch is for those users that were used to having their username and password autofilled. I have been unable to reproduce that ability in my custom form so far.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top