Results 1 to 2 of 2

Combobox returning invalid property error

Threaded View

duckboy1981 Combobox returning invalid... 07-21-2009, 05:13 AM
duckboy1981 Re: Combobox returning... 07-21-2009, 05:24 AM
  1. #1
    Forum Contributor
    Join Date
    09-03-2008
    Location
    Somerset, England
    MS-Off Ver
    XP, 2003, 2007 - depends on location
    Posts
    185

    Combobox returning invalid property error

    Hey all,

    I am getting an error on this peice of code that is supposed to display results from a database and was wondering if anybody could help me figure it out?

    Run-time error '380'

    Could not set the Value property. Invalid property value.
    The Variable exists on the userform and the value held in DOP(0) is in the list range, so its not an invalid entry on that front. The strange thing is DODDay works fine with exactly the same date, while DOPDay gives an error.

    Sub DisplayResults()
    ' Display Results Macro
    ' Displays the results of the found match in the user form
    ' Written by David Gard, 26/06/09
    Dim DOD() As String         ' Holds the Date of Death to be Split
    Dim DOP() As String         ' Holds the Date of Probate to be Split
    ' Shows the correct date so the split definatly works
        DOD = Split(Sheets(wS11.Name).Range("C" & iRow).Value, "/")
        DOP = Split(Sheets(wS11.Name).Range("D" & iRow).Value, "/")
        Set CurrentObject = Options
        With CurrentObject
            MsgBox DOD(0) & "/" & DOD(1) & "/" & DOD(2)
            MsgBox DOP(0) & "/" & DOP(1) & "/" & DOP(2)
        
            .txtSurname.Value = Sheets(wS11.Name).Range("A" & iRow)
            .txtOtherNames.Value = Sheets(wS11.Name).Range("B" & iRow)
            .comDODDay.Value = DOD(0)
            .comDOPDay.Value = DOP(0) ' Errors here
            .comDODMonth.Value = DOD(1)
            .comDOPMonth.Value = DOP(1)
            .comDODYear.Value = DOD(2)
            .comDOPYear.Value = DOP(2)
            .txtArchiveNo.Value = Sheets(wS11.Name).Range("E" & iRow)
            .txtBoxNo.Value = Sheets(wS11.Name).Range("F" & iRow)
            .txtBarcode.Value = Sheets(wS11.Name).Range("G" & iRow)
        End With
        Set CurrentObject = Nothing
    End Sub
    Thanks very much.
    Last edited by duckboy1981; 07-21-2009 at 05:23 AM.
    Ducks are better crispy...

Thread Information

Users Browsing this Thread

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

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