Hello, I have a calender composed of 37 text boxes (one for each day of a month) which when run, uses the following code to extract job#s from a table for the appropriate date.
My problem is that frequently there are multiple jobs scheduled for a particular date and I am not able to display more than one job for the date. I need to be able to display multiple job#s on separate lines within a single text box.
thanks for any help.
Code:
Set f = Forms!frmCalender
For i = 1 To 37
f("text" & i) = Null
Next i
sql = "SELECT [Job#],[Date Scheduled] FROM [Job Information] WHERE ((MONTH([Date Scheduled]) = " & f!month & " AND YEAR([Date Scheduled]) = " & f!year & ")) ORDER BY [Date Scheduled];"
Set db = CurrentDb()
Set rs = db.OpenRecordset(sql, dbOpenSnapshot)
If rs.RecordCount > 0 Then
For i = 1 To 37
If IsDate(f("date" & i)) Then
rs.FindNext "[Date Scheduled]=#" & f("date" & i) & "#"
If Not rs.NoMatch Then
f("text" & i) = rs![job#]
End If
End If
Next i
End If
thanks for any help.