I'm must be missing something, My query works as expected
It prompts me for the week number and returns the data I need. What I need is to assign that week number that was just used in the query to a variable.
I need use the same week number to check for records in a table before I appended new records.
I hope this makes sense.
Thanks
Gil
User Profile
Collapse
-
Variable from Parameter Query
Is there a way to assign the data from and Input box of a parameter query to a variable?
Here's the parameter for the query;
((DatePart('ww' ,[dbo_Hse.ExpDate],2,2))=[Enter Week Number]))
I would like to assign the "Week Number" the user enters to a variable.
Thanks for any and all suggestions
Gil -
Sorry but I'm confused again!
Did you test the code with or without the DoCmd.OpenRepor t & the Option Group?Leave a comment:
-
The "WhatYear" function code.
The changes you suggested did not work.Leave a comment:
-
No problem, I deal with the same problem.
So, Do you have any other suggestions on how to convert
this code to a function? Or should I just add it to each button?
GilLeave a comment:
-
ADezii,
Thanks for the prompt response.
I added your changed code as a private function of the form code module. Selecting a different year still has no effect on the date range of the report.
[Code]
Private Function fWhatYear()
Dim strCriteria As String
If IsNull(Me.Seaso ns) Then Exit Function
Select Case Me.Seasons
Case 2009
strCriteria = "[ExpDate] Between...Leave a comment:
-
Converting to a Function
I'm using this Select Case code in conjunction with a Option Group on a multi-tab form with about 40 run report buttons. The code works fine when included in the Click Event code of a button. I would like to convert it to a function for obvious reasons. I have tried a few variation of a function with no success. What is the best approach for converting a procedure to a function.
...Code:Private Sub WhatYear() Dim strCriteria
No activity results to display
Show More
Leave a comment: