Results 1 to 3 of 3
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,095

    Can't spot the mismatch error

    I Get:


    Click image for larger version. 

Name:	001.jpg 
Views:	11 
Size:	30.6 KB 
ID:	53065

    The error occurs on the DLookup. In the switchboard, ItemHelp is String; QSwitchboard is table; SwitchboardID is number; ItemNumber is number.

    Code:
    Code:
    Public Function ChoseDay(MenOpt As Integer)
    Dim strHELPFile As String
    
    
    On Error GoTo ErrorHandler
    
    
    If bolHELP Then
        If SwitchboardID = 2 And MenOpt = 5 Then
            strHELPFile = Nz(DLookup("ItemHelp", "QSwitchboard", "SwitchboardID = 2" And "ItemNumber = 5"))
            If Len(strHELPFile) > 0 Then Call ShowHELP(strHELPFile)
            Exit Function
        End If
    End If
    
    
    'Bypass choice options if we're not in the Menus options
    If SwitchboardID <> 2 Then
        Call HandleButtonClick(MenOpt)
        Exit Function
    End If
    
    
    Me.lblChoose.Visible = True
    Me.cboChoose.Visible = True
    Me.cboChoose.SetFocus
    Me.cboChoose.Dropdown
    
    
    ErrorHandler:
        MsgBox "Error encountered in 'ChoseDay'.  Menu ID is " & SwitchboardID & " and the menu item is " & MenOpt & _
               " The error is " & Err.Number & " and description is: " & Err.Description
               Exit Function
    
    
    End Function

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    And needs to be within the quotes.

    strHELPFile = Nz(DLookup("ItemHelp", "QSwitchboard", "SwitchboardID = 2 And ItemNumber = 5"))
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,095
    Thanks June! As usual, staring me right in the face!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 15
    Last Post: 03-18-2022, 03:12 PM
  2. Replies: 9
    Last Post: 12-13-2016, 03:06 PM
  3. Can't Figure out Type Data Mismatch error
    By Caplan1269 in forum Programming
    Replies: 6
    Last Post: 03-06-2013, 11:55 AM
  4. Replies: 2
    Last Post: 04-21-2012, 04:10 PM
  5. Error 13 Type Mismatch error
    By GlennBurg in forum Programming
    Replies: 1
    Last Post: 06-21-2011, 03:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums