fryguy5049
Technical User
I am using Access 2000 with an Access db,forms,querys,modules.
I have a command button on a form that executes VB code/module. The form also has 2 text boxes to use as date parameters(begin & end date) in the query.
How do I get those parameters into the VB code?
I get the error "Run time error 3061, too few parameters, expected 2"
I have seen many other threads concerning this issue but they are not my exact situation and my inexperience in VB limits me from adpating the solutions. Could you look at this code and suggest a solution. Thanks!
I have a command button on a form that executes VB code/module. The form also has 2 text boxes to use as date parameters(begin & end date) in the query.
How do I get those parameters into the VB code?
I get the error "Run time error 3061, too few parameters, expected 2"
I have seen many other threads concerning this issue but they are not my exact situation and my inexperience in VB limits me from adpating the solutions. Could you look at this code and suggest a solution. Thanks!
Code:
Sub ExportTextFile()
Dim db As Database, rst As DAO.Recordset
Dim qdf As QueryDef
Dim Directory As String
Dim MyString As String, strSQL As String
Dim strPARAM As Parameter
Set db = CurrentDb
Directory = (Mid(db.Name, 1, Len(db.Name) - Len(Dir(db.Name))))
Open Directory & "\TestOutput.txt" For Output As #1
Set rst = db.OpenRecordset("FDR batch xport")
Print #1, "HDAJFEBB" & Format(Date, "mmddyy") & Format(Time, "hhmmss")
rst.MoveFirst
Do While Not rst.EOF
MyString = rst!acct
Print #1, MyString
rst.MoveNext
Loop
Print #1, "TLAJFEBB"
ExportTextFile_Exit:
' Close text file.
Close #1
rst.Close
Set db = Nothing
Exit Sub
End Sub