![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Here is a bit of code from the middle of a long module for creating a Mail merge data file If Left(strSQL, 10) = "PARAMETERS" Then Stop ' ????????????? End If Set rstOutput = CurrentDb.OpenRecordset(strSQL, , dbSeeChanges) The strSQL comes from a variely of sources such as a query, a form or report's record source or a table . If there are no parameters, everything works perfectly. So we must assume there is no QueryDef associared with the strSQL string 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? Thanks Phil -Tom. |
#3
| |||
| |||
|
|
On Sun, 12 Dec 2010 17:14:25 GMT, "Phil" <phil (AT) stantonfamily (DOT) co.uk wrote: Via the parameters collection of the Querydef object. Off the cuff: dim qd as dao.querydef set qd=currentdb.createquerydef("",sql) debug.print qd.parameters.count qd![Enter date of last New Member's Evening].Value = #1/1/2010# set rs = qd.openrecordset(dbOpenSnapshot,dbSeeChanges) -Tom. Here is a bit of code from the middle of a long module for creating a Mail merge data file If Left(strSQL, 10) = "PARAMETERS" Then Stop ' ????????????? End If Set rstOutput = CurrentDb.OpenRecordset(strSQL, , dbSeeChanges) The strSQL comes from a variely of sources such as a query, a form or report's record source or a table . If there are no parameters, everything works perfectly. So we must assume there is no QueryDef associared with the strSQL string 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? Thanks Phil -Tom. Microsoft Access MVP |
![]() |
| Thread Tools | |
| Display Modes | |
| |