L
Liora
How can I run an Query with parameters in Moudle.
I have a old function that was working and there I wrote:
-----------------------
Dim db As Database
Dim t As DAO.Recordset, R As DAO.Recordset, x As
DAO.Recordset
Dim I As Integer
Dim str As String
Dim MYQUERY As QueryDef
Set db = CurrentDb
Set t = db.OpenRecordset("T-CHOOSE-DAT", DB_OPEN_TABLE)
DoCmd.RunMacro ("M_DEL_PERIOD.DELREC2")
While Not t.EOF
DoCmd.RunMacro ("M_DEL_PERIOD.DELTAB")
I = I + 1
Set MYQUERY = db.QueryDefs(QRY)
MYQUERY.Parameters(Forms![R-Order Status Dialog33]!
[FDAT]) = t![FDAT]
MYQUERY.Parameters(Forms![R-Order Status Dialog33]!
[TDAT]) = t![TDAT]
I have a old function that was working and there I wrote:
-----------------------
Dim db As Database
Dim t As DAO.Recordset, R As DAO.Recordset, x As
DAO.Recordset
Dim I As Integer
Dim str As String
Dim MYQUERY As QueryDef
Set db = CurrentDb
Set t = db.OpenRecordset("T-CHOOSE-DAT", DB_OPEN_TABLE)
DoCmd.RunMacro ("M_DEL_PERIOD.DELREC2")
While Not t.EOF
DoCmd.RunMacro ("M_DEL_PERIOD.DELTAB")
I = I + 1
Set MYQUERY = db.QueryDefs(QRY)
MYQUERY.Parameters(Forms![R-Order Status Dialog33]!
[FDAT]) = t![FDAT]
MYQUERY.Parameters(Forms![R-Order Status Dialog33]!
[TDAT]) = t![TDAT]