VBA SQL Requery

shamas21

Registered User.
Local time
Today, 20:06
Joined
May 27, 2008
Messages
162
Hello

I have a query within my form.

I want to change the record source so it filters information down.

im using the following code but will not execute.
---------------------------------------------------------
Dim sSQLall

sSQLall = "SELECT * FROM qSearch"

subfrmQrySearch.Form.RecordSource = sSQLall
---------------------------------------------------------

but this will not change the record source of the embedded query within my form.

Any suggestions?

Thanks
 
a. You may have to fully qualify this. Something like:

forms!myMainForm!subfrmQrySearch.Form.RecordSource = sSQLall

b. 'subfrmQrySearch' needs to be the subform 'control' name. Not the name of form itself. (Why is that so hard to explain? :p)
 
Hi guys,
I'm another newby to MS Access.
Here I have the similar problem.
In my case, I have a sort button in Form1. When the sort button is clicked.
Form 2 pop up with sorting criteria. When Form2 close Form1 will display data in
sorted order.
I want to keep the original RecordSource and later on when click sort button again
Form2 will process on that RecordSource.

Do you have any idea?
 
In addition, what I'm thinking of now is doing the string manipulation to
extract the original RecordSource out of the modified one.
(if I can't find any better way).
 

Users who are viewing this thread

Back
Top Bottom