Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Run-time error '380' Invalid property value.

I am using an Excel 2003 VBA UserForm to enter data onto a worksheet.

On the UserForm I have a Navigation bar to navigate through the records held
on the worksheet to view them on the form; i.e. First, Next, Previous and
Last.

The navigation bar successfully locates each record and the code I use to
gather the data from the worksheet to display on the UserForm also works
successfully, see below €˜Sub FillInData()

The Navigation bar also has a button to enable me to save a new record onto
the Worksheet and then sort the records into the required sequence.

As soon as a new record has been saved and I navigate to another record an
error message appears:

Run-time error €˜380;
Could not set the property value. Invalid property value.

The line of code causing the problem is

frmBudgetInput.cboLevel4.Value = arrData(2)

The frustrating thing is that if I edit a record and press the save button
and then navigate away the problem does not occur.

Is there a way of determining what property value is Invalid, to give me a
clue how to rectify the problem?


Sub FillInData()
' Populate the forms with data from the WorkSheet
' Data from Budget Input Worksheet to frmBudgetInput

' Go to first record on sheet
Worksheets("Budget Input").Select
Cells(6, 1).Select
iCellValue = ActiveCell.Value
' Find the record
Do While iCellValue < iCheckRef
ActiveCell.Offset(1, 0).Select
iCellValue = ActiveCell.Value
Loop
' Gather the Data
Dim i As Integer
For i = 1 To 6
arrData(i) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
Next
' Fill in the data
frmBudgetInput.cboLevel4.Value = arrData(2)
frmBudgetInput.txtCost.Text = arrData(3)
frmBudgetInput.txtDesc.Text = arrData(4)
frmBudgetInput.cboLevel1and2.Value = arrData(5)
frmBudgetInput.cboLevel3.Value = arrData(6)
' return to column A
ActiveCell.Offset(0, -6).Select
End Sub

Many thanks in anticipation

--
Derek Dowle
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Run-time error '380' Invalid property value.

You're not showing us enough to make a determination of your problem. I just
recreated what you've shown us and the code ran fine (had to declare the
iCheckRef only).
I suggest you repost with more info.
--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Derek Dowle" wrote:

I am using an Excel 2003 VBA UserForm to enter data onto a worksheet.

On the UserForm I have a Navigation bar to navigate through the records held
on the worksheet to view them on the form; i.e. First, Next, Previous and
Last.

The navigation bar successfully locates each record and the code I use to
gather the data from the worksheet to display on the UserForm also works
successfully, see below €˜Sub FillInData()

The Navigation bar also has a button to enable me to save a new record onto
the Worksheet and then sort the records into the required sequence.

As soon as a new record has been saved and I navigate to another record an
error message appears:

Run-time error €˜380;
Could not set the property value. Invalid property value.

The line of code causing the problem is

frmBudgetInput.cboLevel4.Value = arrData(2)

The frustrating thing is that if I edit a record and press the save button
and then navigate away the problem does not occur.

Is there a way of determining what property value is Invalid, to give me a
clue how to rectify the problem?


Sub FillInData()
' Populate the forms with data from the WorkSheet
' Data from Budget Input Worksheet to frmBudgetInput

' Go to first record on sheet
Worksheets("Budget Input").Select
Cells(6, 1).Select
iCellValue = ActiveCell.Value
' Find the record
Do While iCellValue < iCheckRef
ActiveCell.Offset(1, 0).Select
iCellValue = ActiveCell.Value
Loop
' Gather the Data
Dim i As Integer
For i = 1 To 6
arrData(i) = ActiveCell.Value
ActiveCell.Offset(0, 1).Select
Next
' Fill in the data
frmBudgetInput.cboLevel4.Value = arrData(2)
frmBudgetInput.txtCost.Text = arrData(3)
frmBudgetInput.txtDesc.Text = arrData(4)
frmBudgetInput.cboLevel1and2.Value = arrData(5)
frmBudgetInput.cboLevel3.Value = arrData(6)
' return to column A
ActiveCell.Offset(0, -6).Select
End Sub

Many thanks in anticipation

--
Derek Dowle

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error '380' Costas Limassol[_2_] Excel Programming 0 February 15th 10 06:59 PM
Run-time error '380' Ozgur Pars[_2_] Excel Programming 1 March 28th 07 05:01 AM
ControlSource and Localization Issue?? (run-time error '380' Could not set the ControlSource property) TCook Excel Programming 1 March 4th 07 08:12 AM
Run-Time Error '380' Fred Holmes Excel Programming 0 October 27th 06 04:49 PM
Run-time error '380' Nocky Excel Programming 0 October 26th 04 12:50 AM


All times are GMT +1. The time now is 03:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"