B
beeyule
I'm getting a type mismatch with the following and it's
highlighting the Set rst section, anybody see what's
going on?
Private Sub Write_Credit_AfterUpdate()
Dim db As Database
Dim rst As Recordset
Dim strSQL As String
strSQL = " SELECT dbo_CREDITS_DETAIL.TTNUM,
dbo_CREDITS_DETAIL.Full_Item, dbo_CREDITS_DETAIL.Price,
dbo_CREDITS_DETAIL.QTY" & _
" FROM dbo_CREDITS_DETAIL" & _
" WHERE (dbo_CREDITS_DETAIL.TTNUM = " & Me!TTNUM
& ")"
Set db = CurrentDb
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset) TELLING
ME PROBLEMS IS HERE.
Dim strHeader As String, strBody As String
strHeader = "01" & Me!CUST_NUMBER & "," & Me!CUST_NAME
strBody = "02" & "6" & "," & "1" & "," & Me!TTNUM & "," &
Me!TTCode
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("H:\Text_Files\Test.txt", True)
a.WriteLine (strHeader)
a.WriteLine (strBody)
Do Until rst.EOF
a.WriteLine (rst)
rst.MoveNext
Loop
a.Close
End Sub
highlighting the Set rst section, anybody see what's
going on?
Private Sub Write_Credit_AfterUpdate()
Dim db As Database
Dim rst As Recordset
Dim strSQL As String
strSQL = " SELECT dbo_CREDITS_DETAIL.TTNUM,
dbo_CREDITS_DETAIL.Full_Item, dbo_CREDITS_DETAIL.Price,
dbo_CREDITS_DETAIL.QTY" & _
" FROM dbo_CREDITS_DETAIL" & _
" WHERE (dbo_CREDITS_DETAIL.TTNUM = " & Me!TTNUM
& ")"
Set db = CurrentDb
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset) TELLING
ME PROBLEMS IS HERE.
Dim strHeader As String, strBody As String
strHeader = "01" & Me!CUST_NUMBER & "," & Me!CUST_NAME
strBody = "02" & "6" & "," & "1" & "," & Me!TTNUM & "," &
Me!TTCode
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("H:\Text_Files\Test.txt", True)
a.WriteLine (strHeader)
a.WriteLine (strBody)
Do Until rst.EOF
a.WriteLine (rst)
rst.MoveNext
Loop
a.Close
End Sub