S
Song Su
No error when compiling but when open form, got 'type mismatch'. Here is the
code:
Private Sub Form_Load()
If DLookup("[userid]", "users", "Trim([userid]) = '" &
Left(fOSUserName(), 8) & "' AND [EmailAll] = " & -1) Then
cmdMassEmail.Enabled = True
ElseIf DLookup("[userid]", "users", "Trim([userid]) = '" &
Left(fOSUserName(), 8) & "' AND [Grade] = " & -1) Then
cmdGrade.Enabled = True
End If
End Sub
Both [EmailAll] and [Grade] are logical fields. I got fOSUserName from
http://www.mvps.org/access/api/api0008.htm
code:
Private Sub Form_Load()
If DLookup("[userid]", "users", "Trim([userid]) = '" &
Left(fOSUserName(), 8) & "' AND [EmailAll] = " & -1) Then
cmdMassEmail.Enabled = True
ElseIf DLookup("[userid]", "users", "Trim([userid]) = '" &
Left(fOSUserName(), 8) & "' AND [Grade] = " & -1) Then
cmdGrade.Enabled = True
End If
End Sub
Both [EmailAll] and [Grade] are logical fields. I got fOSUserName from
http://www.mvps.org/access/api/api0008.htm