In my main menu form I have provided a button to check the tasks due as a reminder. In this assigned to field is coming as number , because in in my table it is of number type & it is linked to contact table to retrieve the data. So in my message box I need this number to be converted as the data stored my contact table. & also I can't increase the size of the message box so it is looking messy. please go through the attached images and code & help me.[table][messagebox[]][datatype restriction`
Option Compare Database
Private Sub cmdreminder_Click()
Dim RS As DAO.Recordset
Dim strMsg As String
Set RS = CurrentDb.OpenRecordset("Tasks", dbOpenSnapshot, dbReadOnly)
With RS
If Not (.BOF And .EOF) Then
.MoveFirst
While Not .EOF
If ![Due Date] >= Date - 7 Then
strMsg = strMsg & ![Title] & vbTab & vbTab & vbTab & ![Assigned to] & vbTab & vbTab & vbTab & ![Due Date] & vbCrLf
End If
.MoveNext
Wend
End If
.Close
End With
Set RS = Nothing
If strMsg <> "" Then
strMsg = "The following Tasks are due!!!:" & vbTab & vbTab & vbCrLf & vbCrLf &"-----------" & vbCrLf &"Equipment Name" & vbTab & vTab & "Agency Name" & vTab & vbTab & "Due Date" & vbCrLf &"----" & vbCrLf & strMsg Else strMsg = "No Tasks is pending" End If MsgBox strMsg, vbInformation + vbOKOnly End Sub ``]