A user can set two parameters on my form - one is text, the other a date.
An event opens a recordset for an existing query. This query is based on another query which takes 2 parameters - [myCourse] and [myDate] the data types of these parameters has been set in qryManualCount (which qryManualCount2 uses)
Dim dbs As Database
Dim qdf1 As QueryDef
Set dbs = CurrentDb
Set qdf1 = dbs.QueryDefs![qryManualCount2]
qdf1.Parameters![myCourse] = Me!myCourse
qdf1.Parameters![myDate] = Me!txtDate
Me!lstCourse.RowSource = qdf1.SQL
The problem is I get a dialog asking for a value for the [myDate] parameter even though I can see an appropriate value for that parameter when I inspect qdf1 using the debug window.
If I enter the date in the dialog I get the correct data, but cancelling/OKing the dialog means that nothing is returned.