Is this the kind of thing you are looking for:
Dim db as Database
Dim qdf As QueryDef
Set db = CurrentDb()
Set qdf = db.QueryDefs!yourquery
qdf.Parameters("date1parameter") = mdate1
qdf.Parameters("date2parameter") = mdate2
Me.Recordset = qdf.OpenRecordset()
This one sounds like what I am looking for. I come from a VPF
background recordsets are difficult for me.
I found something similar.
Set qdf = CurrentDB.OpenQueryDef(qryName)
In Access 2007 OpenQueryDef is not a method of CurrentDB.
Or, maybe all you want to do is set the form's Filter
property??
I am afraid I don't even know what that is.
Or, if all this is part of opening the form, then the code
that opens the form should be using the OpenForm method's
WhereCondition argument to filter the form's record source.
Err ?????
To much guessing here. You should explain WHAT you are
trying to accomplish instead of asking about how to take the
next step down the path of your attempted solution.
Thank you very much for your help!
Sorry I am not deliberately trying to be vague.
This is my first access application I want show planned customer
contact between two dates.
a two date boxes and a form list.
I am doing this to help a friend who has been handed a whole lot of new
reporting requirements and no tools to do the job. The work computer
is locked down so I can't write something in VFP for her. I found
Access 2003 on her machine so I decided to write an Access program.
Why do I even have Access? My wife wanted Publisher for work so I
bought her Office Professional 2007.