What's wrong with the VBA?

J

John

Hi Brother,


In the form 'PLCX',there is a combobox "combo71" where I can select
different values(eg: A,B,C)

and there is a Command_Click in the form 'PLCX', which stands for a VBA as
follows:


Dim QY As String

QY = Me.Combo71

Select Case QY

Case QY = "A"

DoCmd.OpenQuery "DLRQ", acNormal, acEdit

Case QY = "B"
....
End Select




When I key "A" in the combo71 and run this VBA,I can open the Query
"DLRQ",however,it does just display 0 records .Actually,it should list where
the field [QY] in the query "DLRQ" is equal to the "combo71" in the form
"PLCX" .

So,what's wrong with the VBA?

If I want to open this query and only show me the list where the [QY] in the
table is equal to the "combo71" in the form "PLCX" .

How should I write this VBA?

Thanks
 
N

ntc

your VBA works

you have Case Select A to open query and the query opens; thus your VBA works.

your issue is; why does the query not return the records you expect?

where is the query getting its filter/paramter criteria??

you should be able to manually run that query for test/debug...all the vba
is doing is triggering when it opens...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top