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.
Bookmarks