+ Reply to Thread
Results 1 to 2 of 2

Type mismatch

  1. #1
    Registered User
    Join Date
    02-16-2015
    Location
    Dubai
    MS-Off Ver
    2010
    Posts
    2

    Angry Type mismatch

    Hi, Please check my code here as there is a type mismatch when I am trying to get the data from the Excel sheet.
    My data is like this..

    Entered Entered By Name Customer Name Product C-View No. C-View % Location Annual Gross ZDS Checklist
    01/25/2015 15:02:51 tin Mafaz Maya Paris Ocean Qatar With SOP

    it cannot retrieve the column NAME, thanks!!!

    Private Sub cmdUpdateDropDowns_Click()
    strSQL = "Select Distinct [Name] From [PartsData$] Order by [Name]"
    closeRS
    OpenDB
    cmbBDNAME.Clear

    rs.Open strSQL, cnn, adOpenKeyset, adLockOptimistic
    If rs.RecordCount > 0 Then
    Do While Not rs.EOF
    cmbBDNAME.AddItem rs.Fields(0)
    rs.MoveNext
    Loop
    Else
    MsgBox "I was not able to find any unique Products.", vbCritical + vbOKOnly
    Exit Sub
    End If

    '----------------------------
    strSQL = "Select Distinct [Location] From [PartsData$] Order by [Location]"
    closeRS
    OpenDB
    cmbLocation.Clear

    rs.Open strSQL, cnn, adOpenKeyset, adLockOptimistic
    If rs.RecordCount > 0 Then
    Do While Not rs.EOF
    cmbLocation.AddItem rs.Fields(0)
    rs.MoveNext
    Loop
    Else
    MsgBox "I was not able to find any unique Region(s).", vbCritical + vbOKOnly
    Exit Sub
    End If
    '----------------------
    strSQL = "Select Distinct [ZDS Checklist] From [PartsData$] Order by [ZDS Checklist]"
    closeRS
    OpenDB
    cmbZDS.Clear

    rs.Open strSQL, cnn, adOpenKeyset, adLockOptimistic
    If rs.RecordCount > 0 Then
    Do While Not rs.EOF
    cmbZDS.AddItem rs.Fields(0)
    rs.MoveNext
    Loop
    Else
    MsgBox "I was not able to find any unique Customer Type(s).", vbCritical + vbOKOnly
    Exit Sub
    End If
    End Sub

  2. #2
    Registered User
    Join Date
    02-16-2015
    Location
    Dubai
    MS-Off Ver
    2010
    Posts
    2

    Re: Type mismatch

    Help please

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Run Type error 13 Type Mismatch
    By Affan Khan in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-13-2012, 12:58 PM
  2. [SOLVED] Run-type error 13 type mismatch
    By misop in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-05-2012, 04:08 AM
  3. [SOLVED] Type Mismatch: array or user defined type expected
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2006, 10:45 AM
  4. [SOLVED] Type mismatch using rnge as Range with Type 8 Input Box
    By STEVE BELL in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-03-2005, 01:10 AM
  5. [SOLVED] Help: Compile error: type mismatch: array or user defined type expected
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2005, 05:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1