![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Here is a sample of an actual strSQL string PARAMETERS [Enter date of last New Member's Evening] DateTime; SELECT DISTINCT QAddressLabelsFamily.* FROM Member INNER JOIN QAddressLabelsFamily ON Member.[MemHeadOfHouseID] = QAddressLabelsFamily.[MemHeadOfHouseID] WHERE (((Member.MemJoinDate)>[Enter date of last New Member's Evening])) ORDER BY QAddressLabelsFamily.MemSurName; How do I get the "Enter parameter" box to open and pass the parameter to the recordset? |
#3
| |||
| |||
|
|
"Phil" <phil (AT) stantonfamily (DOT) co.uk> wrote in news:ie2vgs$c8i$1 (AT) speranza (DOT) aioe.org: Here is a sample of an actual strSQL string PARAMETERS [Enter date of last New Member's Evening] DateTime; SELECT DISTINCT QAddressLabelsFamily.* FROM Member INNER JOIN QAddressLabelsFamily ON Member.[MemHeadOfHouseID] = QAddressLabelsFamily.[MemHeadOfHouseID] WHERE (((Member.MemJoinDate)>[Enter date of last New Member's Evening])) ORDER BY QAddressLabelsFamily.MemSurName; How do I get the "Enter parameter" box to open and pass the parameter to the recordset? If you're executing the SQL in code and it's not a saved QueryDef, then use SQL that omits the parameter(s) and just collect the data from the user with a form, and write your SQL with that. Now, some will claim that opens you to SQL injection, but in an Access app, the danger there is quite small. And you can easily avoid that by using certain assumptions about the criteria. If you really want to use parameters, you have to open the query def, assign the parameter values and then execute it. For what it's worth, I've never done that even once in my 14 years of programming Access professionally. I just provide the WHERE clause at runtime. |
![]() |
| Thread Tools | |
| Display Modes | |
| |