RichardMGreen
Well-known Member
- Joined
- Feb 20, 2006
- Messages
- 2,177
Hi all
I'm fairly new to this so be gentle with me.
I've got a few queries to run in a database but some need parameters.
Here's what I've got so far:-
I've got the dates sorted but I can't seem to pass them to the query to use instead of a prompt box.
Anyone any ideas?
I'm fairly new to this so be gentle with me.
I've got a few queries to run in a database but some need parameters.
Here's what I've got so far:-
Code:
Function test()
Dim qdf As QueryDef
reducer = 7
While Format(Date - reducer, "Dddd") <> "Monday"
reducer = reducer + 1
Wend
agent_start_date = Date - reducer
leave_start_date = agent_start_date - 98
qrystartdate = InputBox("Enter Start date of data", "First day of Data Required", Date - 7)
DoCmd.OpenQuery ("Update_Agent_Information")
DoCmd.OpenQuery ("Append_Agent_Information")
qdf.Parameters(0) = agent_start_date
DoCmd.OpenQuery ("Delete_Agent_Leave")
qdf.Parameters(0) = agent_start_date
DoCmd.OpenQuery ("Update_Agent_Leave")
qdf.Parameters(0) = agent_start_date
DoCmd.OpenQuery ("Append_Agent_Leave")
qdf.Parameters(0) = leave_start_date
DoCmd.OpenQuery ("Output_Query")
End Function
I've got the dates sorted but I can't seem to pass them to the query to use instead of a prompt box.
Anyone any ideas?