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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

clear Command$

Status
Not open for further replies.

drctx

IS-IT--Management
May 20, 2003
226
US
is there a way to clear the command line arguement that is stored in Command$?

i've tried
Command$ = Null
Command$ = ""
i get this error "Function call on left side of assignment must return Variant or Object"

Set Command$ = Nothing
i get this error "Invalid use of Property
 
Why in the world would you want to?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
i'm using it as the criteria in a query for a recordsource of a form and need to clear Command$ on form close.
 
But why do you need to clear it? What is wrong with leaving its contents alone? Does it break something? If so what?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
when the database is opened and there is a command line arguement i want the form to only display the record that matches the Command$ value else it should show all.
 
So why do you need to clear the command line? If there is content on the command line, it sounds like you need it to control your form. Why get rid of it? Is it so that if the user opens the form again, the form shows all?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
i came up with a work around for clearing command$.

in the database shortcut i run a macro that calls a function to store Command$ in a variable, then on the close of the form i clear cmdLine. the next time the from is opened the query returns all records.

Function openSubmitted()
cmdLine = Command$
DoCmd.OpenForm "SubmittedRequests"
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top