I forgot to attach the code in the previous message
Dim stDocName As String
Dim ContactMethod As Integer
Dim strCompany As Integer
ContactMethod = DLookup("[Preferred Contact Method]", "[Dr
Table]", [CHCS MSS ID] = Me.DRLOOKUP)
strCompany = DLookup("[Company]", "[Dr Table]", [CHCS MSS ID] =
Me.DRLOOKUP)
If strCompany = 1 Then
If ContactMethod = 1 Then
stDocName = "CHCS FAX INDIVIDUAL DR"
ElseIf (ContactMethod = 2 Or ContactMethod = 3) Then
stDocName = "CHCS PRINT INDIVIDUAL DR"
ElseIf ContactMethod = 4 Then
stDocName = "CHCS EMAIL INDIVIDUAL DR"
End If
End If
If strCompany = 2 Then
If ContactMethod = 1 Then
stDocName = "CHOICE FAX INDIVIDUAL DR"
ElseIf (ContactMethod = 2 Or ContactMethod = 3) Then
stDocName = "CHOICE PRINT INDIVIDUAL DR"
ElseIf ContactMethod = 4 Then
stDocName = "CHOICE EMAIL INDIVIDUAL DR"
End If
End If
DoCmd.RunMacro stDocName
selgin said:
I have a form "Individual Report" which uses two combo boxes, one to
select the company, and one to select the doctor. It works when I
select company 1 but gives the error "Invalid use of Null" when i
attempt to use company 2.