jamaarneen
Programmer
Hi to all of you
I have an 'unbound' listbox on my form ('bound'), with as RowSource a Parameter-query.
What I would like is, that in the 'OnCurrent' event of the form, the 'Parameter' should be entered by code.
Some facts:
The parameter is expecting a number (representing a weekday: 1 for Sunday, ...). In the recordset of my form there is a field (named: ReqDel_date) containing a date. When I open the form or navigate to another record (so 'ReqDel_Date' gets a new date), I would like to requery the query of the listbox's RowSource, and entering a new value for the parameter.
I tried to make it with QueryDefs Something like that:
at the last line - the red, it is getting an error: Type mismatch.
I have no idea if I'm almost there, or am I totally in the wrong direction...
Thanks in advanced for your help
Ja
I have an 'unbound' listbox on my form ('bound'), with as RowSource a Parameter-query.
What I would like is, that in the 'OnCurrent' event of the form, the 'Parameter' should be entered by code.
Some facts:
The parameter is expecting a number (representing a weekday: 1 for Sunday, ...). In the recordset of my form there is a field (named: ReqDel_date) containing a date. When I open the form or navigate to another record (so 'ReqDel_Date' gets a new date), I would like to requery the query of the listbox's RowSource, and entering a new value for the parameter.
I tried to make it with QueryDefs Something like that:
Code:
Dim db As Database
Dim qdf As QueryDef
Dim rst As DAO.Recordset
Set db = CurrentDb
Set qdf = db.QueryDefs("qryVolunteerRelevantList")
qdf.Parameters("[enter weekday]") = Weekday(Me.ReqDel_Date)
Set rst = qdf.OpenRecordset()
Me.lstVolounteersRelevant[red].RowSource [/red]= rst
at the last line - the red, it is getting an error: Type mismatch.
I have no idea if I'm almost there, or am I totally in the wrong direction...
Thanks in advanced for your help
Ja