Results 1 to 4 of 4
  1. #1
    dccjr3927 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    130

    Type Mismatch in If statement

    I know this is a simple one, but I have stared at it so long, I can't see it. It is throwing a Type Mismatch on the second If statement.

    Code:
    Private Sub cbxProductSKU_AfterUpdate()
    Dim curRepCost As Variant
    Me.tbxRepCost.Locked = True
        If Me.cbxMarketplace = "Contract - VendorJump" Then
            If Me.cbxDefectCat = "In-House" Or "Customer" Then
                curRepCost = DLookup("ReplaceCost", "Inventory", "SKU = '" & Me.cbxProductSKU & "'")
                Me.tbxAddRefund.Value = 0
                Me.tbxRepCost.Value = curRepCost
                Me.tbxRepCost.Locked = True
                Me.tbxTotalAmount = Me.tbxRepCost + Me.tbxAddRefund
            Else
            End If
        Else
            Me.tbxRepCost.Value = 0
            Me.tbxRepCost.Locked = True
        End If
    End Sub
    Could someone please point out the obvious thing that I am missing.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You have to repeat the field:

    If Me.cbxDefectCat = "In-House" Or Me.cbxDefectCat = "Customer" Then
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    dccjr3927 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    130
    Thanks. I actually just saw after walking away. Just when I thought I was getting better at seeing these things.

    Thank you.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No problemo.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 6
    Last Post: 09-24-2019, 06:39 PM
  2. Type mismatch on a "Split" statement
    By GraeagleBill in forum Programming
    Replies: 2
    Last Post: 12-07-2014, 06:55 AM
  3. Replies: 2
    Last Post: 09-16-2014, 09:00 AM
  4. Replies: 2
    Last Post: 08-09-2013, 06:54 AM
  5. Replies: 14
    Last Post: 02-08-2012, 03:36 PM

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