Link to home
Start Free TrialLog in
Avatar of gbnorton
gbnortonFlag for United States of America

asked on

Access DLookup produces runtime error 2471

Hi,
this routine fails with runtime error 2471.  What might be wrong?
Thanks,
Brooks

Private Sub Print_Label_Click()
    Dim strPartNumber As String
    Dim strExists As Integer
    strPartNumber = Me.cboPN
    ' This section sees if part number is axial leaded or chip
    ' See if the diode part number exists in the diodes table
    ' If it is an axial leaded part use Glassing Furnace Diode Label
    ' If it is a chip use Glassing Furnace Chip Label
    strExists = DCount("[P_Number]", "Diodes", "[P_Number] = strPartNumber")
    If strExists <> 0 Then
    Stop
        DoCmd.OpenReport "Glassing Furnace Diode Label", acViewNormal, , "[ID]=" & Me.ID
    Else
    Stop
        DoCmd.OpenReport "Glassing Furnace Chip Label", acViewNormal, , "[ID]=" & Me.ID
    End If
   
End Sub
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gbnorton

ASKER

Perfect.  Thanks for looking on Sunday!
Brooks