Opening Query after combobox selection (1 Viewer)

amona

Registered User.
Local time
Today, 05:13
Joined
Jan 31, 2012
Messages
12
Hi,

I am trying to run query after selecting from cobmbobox list.
I did the following but no luck:
rivate Sub Comb_AfterUpdate()
DoCmd.OpenQuery "Function"
End Sub

And wrote in the criteria
[Forms]![Printer Or Scanner]![Comb]
Function is the query, Printer Or Scanner -- the form.
Could anyone help, please?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 05:13
Joined
Aug 30, 2003
Messages
36,129
What does "no luck" mean? The code looks fine (though I never let users into tables or queries).
 

amona

Registered User.
Local time
Today, 05:13
Joined
Jan 31, 2012
Messages
12
Thanks for the replay.
I am really new to Access… Sorry
I want to run the query from a form after selecting from combobox.
My code is not working
though I never let users into tables or queries
Then, what should I do?
 

Padwan

Registered User.
Local time
Today, 05:13
Joined
Jan 17, 2012
Messages
28
This may be off, but isn't it possible to create combo box with query titles listed in it to select rather than writing code?
 

amona

Registered User.
Local time
Today, 05:13
Joined
Jan 31, 2012
Messages
12
How can I do this?
I am a beginner...
 

amona

Registered User.
Local time
Today, 05:13
Joined
Jan 31, 2012
Messages
12
Could anyone check my code and help to fix it, please?
 

Attachments

  • inventory.zip
    246.8 KB · Views: 152

Users who are viewing this thread

Top Bottom