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

Opening a query?

Status
Not open for further replies.

kpryan

Technical User
Aug 24, 2005
282
US
Hi,
i want to be able to open a query by using the 'On dbl Click'event on a form.

The command I have used is this:
DoCmd.OpenQuery "Accounts_1_StoreOS", , , , "RecordID=" & Me.RecordID

As a test If I use:DoCmd.Openform "Accounts_1", , , , "RecordID=" & Me.RecordID it will open a form.

Is it possible to open the query using th same method. The query is an append query.
When I try to open the query in this way I get an error; Compile error: Wrong number of arguments or invalid property assignment

many thanks

KP
 
Edit the query to include a reference to the current form and RecordID, the syntax you have used will not suit.
 
Howdy kpryan . . .

[blue]DoCmd.OpenQuery[/blue] only has [purple]three arguements:[/purple]
[ol][li][purple]queryname[/purple][/li]
[li][purple]view[/purple][/li]
[li][purple]datamode[/purple][/li][/ol]
There's no arguement for criteria!

From the Db window hit [blue]Ctrl + G[/blue]. Enter [blue]OpenQuery[/blue] in the immediate window and hit [blue]F1[/blue] . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top