Form Does not Display ReQueried Results

Ksabai

Registered User.
Local time
Today, 08:11
Joined
Jul 31, 2017
Messages
104
Iam using using TempVars to change the controls of the query, below is the code

TempVars.Add "tvyr", Trim(Me.cmbCropYear.Value)
Me.RecordSource = "SELECT * FROM [qryNNDocsDue]"
Me.Requery

But the result shown in the datasheet form is for all the Years. Am i writing something wrong here?

Pls advice
 
OpenQuery works fine and shows only the 2 rows that need to be displayed
 
I did not understand why you needed to variable. If you want to take all the years, I think there is no need for any criteria.
 
Ksabai,
You have told us HOW you did something, and that the result of a query doesn't provide the answer you expected. You have not told us WHAT ("the something") you were trying to accomplish. And you did not show readers anything of qryNNDocsDue . More info please.
 
Iam trying to populate the results on a Split - data sheet view form. Will it work on a sub form view.
 
So does qryNNDocsDue have a WHERE = [TempVar]![tvyr] clause?
 
Yes, it's a big access query. And does have 4 where clause using temp variable
 
This link infers you should be using parentheses with your method?

TempVars.Add

Personally I just use Tempvars("tvyr") = <whatever>

Also if you change a form recordsource, there is no need for a requery, you are just duplicating that request.?
 

Users who are viewing this thread

Back
Top Bottom