G
Gina Whipp
I don't know if anyone can help but here it goes. I am trying to understand
this code. I almost had it except now get the error message '13 Type
Mismatch' and when I press debug I get... Set rs = 0 (see where below). I
don't understand can someone help?
As usual thanks in advance!
Gina Whipp
Function fillBDays()
Dim irow As Integer
Dim icol As Integer
Dim tuseday As String
Dim tcheckday As String
Dim ans As String
Dim db As Database
Dim qd As QueryDef
Set db = CurrentDb()
Dim rs As Recordset
Set qd = db.QueryDefs("qryGetMonthBirthdays")
qd!findMonth = Me!Month
Set rs = qd.OpenRecordset() ERRORS OUT HERE Set rs = 0
Dim done As Integer
done = 0
If rs.EOF And rs.BOF Then
Else
Do Until rs.EOF
If Trim(rs!ClientName & "") = "" Then
Else
ans = ""
For irow = 1 To 6
For icol = 1 To 7
tuseday = rs!Day
tcheckday = Trim(Left(Me("lbl" & irow & icol).caption, 2))
If tcheckday = tuseday Then
Me("lbl" & irow & icol).caption = Me("lbl" & irow &
icol).caption & vbCrLf & rs!ClientName
done = 1
End If
If done = 1 Then Exit For
Next icol
If done = 1 Then Exit For
Next irow
End If
rs.MoveNext
done = 0
Loop
End If
rs.Close
Me!ClientIDList.Requery
End Function
this code. I almost had it except now get the error message '13 Type
Mismatch' and when I press debug I get... Set rs = 0 (see where below). I
don't understand can someone help?
As usual thanks in advance!
Gina Whipp
Function fillBDays()
Dim irow As Integer
Dim icol As Integer
Dim tuseday As String
Dim tcheckday As String
Dim ans As String
Dim db As Database
Dim qd As QueryDef
Set db = CurrentDb()
Dim rs As Recordset
Set qd = db.QueryDefs("qryGetMonthBirthdays")
qd!findMonth = Me!Month
Set rs = qd.OpenRecordset() ERRORS OUT HERE Set rs = 0
Dim done As Integer
done = 0
If rs.EOF And rs.BOF Then
Else
Do Until rs.EOF
If Trim(rs!ClientName & "") = "" Then
Else
ans = ""
For irow = 1 To 6
For icol = 1 To 7
tuseday = rs!Day
tcheckday = Trim(Left(Me("lbl" & irow & icol).caption, 2))
If tcheckday = tuseday Then
Me("lbl" & irow & icol).caption = Me("lbl" & irow &
icol).caption & vbCrLf & rs!ClientName
done = 1
End If
If done = 1 Then Exit For
Next icol
If done = 1 Then Exit For
Next irow
End If
rs.MoveNext
done = 0
Loop
End If
rs.Close
Me!ClientIDList.Requery
End Function