Invalid property value error with form Results

I have a form that hides rows, based on the value in a combo box (Male/Female). When the form opens the first time, the combo box is blank. Once you make a selection it hides rows just fine. However, if you go back to the form and try to clear it to see all the rows (Males & Females), I get the "Invalid Property Value Error". What is the code to clear the value in the combo box without getting this error? Thanks.

Have a form in an Excel file. Have a Control on the form
("ControlX"), default value of which is "". When entering
ControlX, check is performed to ensure a prior control
contains an appropriate value. When exiting ControlX
(i.e., upon AfterUpdate), ControlX value is saved to a
global variable for later use. All this works fine during
the normal sequence of events.

However, if the user returns to ControlX and deletes the
value (as in "Oops, I made a mistake"), and then tries to
go to another control, he gets a "Invalid Property Value"
error message generated by Microsoft Forms (or so I infer
from the Blue Bar on the error message popup).

I've tried a couple of different error-trapping structures
to deal with the fact that something out there in the
background obviously doesn't like a null value in
ControlX, including one that set the value back to ""
instead of Null, but so far no luck, still get the
message. Anyone have any suggestions?

Hi All,

I have a problem with a UserForm which contains various different types of controls. I have a button which clears the input to enable a new input. This button clears all of the controls OK and almost every time, it allows a new input. Once in a while, it gives the Invalid Property Value error and no matter what you select on the form, this error shows. Can anyone help me here please? I have no idea why it should work maybe 30 times and then on the 31st try, I get this error.

Thanks in advance for any help.

Regards,

Bill

I have a multipage form in xl2002. After adding some code it has been
giving me an error message if I run a line of code that sets the focus (in
an input error routine). I then get the exact equivalent of:

MsgBox "Invalid property value.", vbExclamation, "Microsoft Forms"

This MsgBox then pops up twice if I try to change tabs, which it then won't
let me do. Or it pops up once if I try to close the form with a cancel,
which it also then won't let me do. I can close the form with the X in the
upper right, but then after the form closes I get this MsgBox.

The line of code with the SetFocus was copied from elsewhere. What is
different on these lines is I am setting the focus on a combo box with a
value that is no longer in the RowSource range. If I comment out the
SetFocus line, run the error code, and set the focus there manually, I have
no problems. The combo box has match required.

I can, of course, not have the program set the focus and let the user
figure out which input has the error. Or I could clear the wrong input.
Neither is ideal. Any other suggestions?

Don <www.donwiss.com> (e-mail link at home page bottom).

First of many noob questions as I attempt to adapt Roy's userform example to my own form.

Im using DTPicker with a checkbox, and entering data into the form works fine. When using the "Find" button, however I get an invalid property value error on the .ContactDate. line when i try to load the form (And I assume all of the dates from DTPicker will have the same error):
With Me    'load entry to form
                .FirstName.Value = c.Offset(0, 1).Value
                .HSClub.Value = c.Offset(0, 2).Value
                .Street.Value = c.Offset(0, 3).Value
                .City.Value = c.Offset(0, 4).Value
                .Zip.Value = c.Offset(0, 5).Value
                .Phone.Value = c.Offset(0, 6).Value
                .Father.Value = c.Offset(0, 7).Value
                .Mother.Value = c.Offset(0, 8).Value
                .Coach.Value = c.Offset(0, 9).Value
                .Sport.Value = c.Offset(0, 10).Value
                .ContactDate.Value = c.Offset(0, 11).Value
                .FollowDate.Value = c.Offset(0, 12).Value
                .Colleges.Value = c.Offset(0, 13).Value
                .SampleDate.Value = c.Offset(0, 14).Value
                .Package.Value = c.Offset(0, 15).Value
                .Price.Value = c.Offset(0, 16).Value
                .Comment.Value = c.Offset(0, 17).Value
                '.cmbAmend.Enabled = True     'allow amendment or
                .DeleteBtn.Enabled = True    'allow record deletion
                '.cmbAdd.Enabled = False      'don't want to duplicate record
                f = 0
            End With


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.

I have a userform with several comboboxes. When I hit the "next" button, it goes to the next row down, but if that is empty, then I'll get an error of:

Runtime error '380'
Could not set the Value property. Invalid property value.

Here's the basics of my code. I will be more than willing to email the file. It's too large to post.

	VB:
	
 LoadRow() 
     
    txtTapeNumber.Text = ActiveCell.Value 
    txtCode.Text = ActiveCell.Offset(0, 1) 
    [B]cboChannel.Value = ActiveCell.Offset(0, 2)[/B]

Hi,

I created a userform in VBA on top of an excel file, which automatically opens whenever someone opens the workbook. Everything works fine, however not on all computers. There are some computers on which is crashes with the following error:

"Runt-time error '380' Invalid property value"

and it goes to

Private Sub Workbook_Open()
UserForm.Show 'Where "MYForm" is the name of your form.
End Sub

which is the code to automatically open the form.

I checked for differences in operating system or excel version but they are all windows xp sp2 with excel 2003. The trouble is that I am not close to on of the computers of which on which it does not work so I cannot check for the differences. Therefore I thought maybe one of you would know what causes the problem?

Could this be due to some reference that might not be loaded (the Microsoft Forms 2.0 Object library)? And how could this be turned on by some VBA code if needed?

Or is it the version of VBA that causes troubles?

Thanks in advance

Hi - I would try the RowSource property using the syntax
you had suggested previously (viz., sheet1!A1:C5 -> This
would give you 3 columns of data available to the combo
control. Then just set ColumnCount, ColoumnHeads,
ColoumnWidth, etc). I would do this manually right on the
property sheet for the control in design mode.

For simple values, I would use a For loop or:
cbo.AddItem "1"
cbo.AddItem "2"
cbo.AddItem "3"
cbo.AddItem "4"

hth -jg

>-----Original Message-----
>I have a user form in Excel that contains a combo box. I
want to
>populate this combo box with four values.
>
>First, can I just key in the values in the ControlSource
property that
>I want? For example.. 1;2;3;4? Or do I need to
reference some cells
>in the Excel worksheet?
>
>Second, if I have to reference some cells, what is the
proper syntax?
>If I key in something like A1:A4, I get an error:
>
>Could not set the ControlSource property. Invalid
property value.
>
>Can someone point me in the right direction?
>
>Thanks.
>
>
>Dennis Hancy
>Eaton Corporation
>Cleveland, OH
>.
>

have a userform with several comboboxes. When I hit the "next" button, it goes to the next row down, but if that is empty, then I'll get an error of:

Runtime error '380'
Could not set the Value property. Invalid property value.

The combobox MatchRequired property is set to False.

Here's the basics of my code. I will be more than willing to email the file. It's too large to post.

Private Sub LoadRow() 
     
    txtTapeNumber.Text = ActiveCell.Value 
    txtCode.Text = ActiveCell.Offset(0, 1) 
    cboChannel.Value = ActiveCell.Offset(0, 2) <--error here 
    cboBrand.Value = ActiveCell.Offset(0, 3) 
    cboFormat.Value = ActiveCell.Offset(0, 4) 
    cboLength.Value = ActiveCell.Offset(0, 5) 
    cboCategory.Value = ActiveCell.Offset(0, 6) 
    cboVersion.Value = ActiveCell.Offset(0, 7) 
    txtTapeTitle.Text = ActiveCell.Offset(0, 10) 
    txtKeywords.Text = ActiveCell.Offset(0, 11) 
    etc...(more txt boxes)
Here is my next button code...

Private Sub cmdNext_Click() 
     
     ' Save form contents before changing rows:
    SaveRow 
     
     ' Increment row number:
    If IsEmpty(ActiveCell) = False Then 
        ActiveCell.Offset(1, 0).Select 
    End If 
     
     ' load info from sheet1 into userform
    LoadRow 
     
     ' Set focus to Name textbox:
    txtTapeNumber.SetFocus 
     
End Sub
this is the last major piece of the puzzle to get this working. If I want to add a new line, that's no problem, it's just on hitting "Next".

Thanks for reading and for the help!

Hi all,

I have the following code in a cmd button on a sheet;

If r = vbYes Then
            
            ActiveSheet.Unprotect Password:=Pass
            
            Range(Cells(start, 1), Cells(finish, 18)).Select
            Selection.Copy
            Call FindNextEmpty
            ActiveCell.Offset(0, -6).Select
            Selection.PasteSpecial Paste:=xlValues
            
            With Selection.Borders(xlEdgeBottom)
                .LineStyle = xlDot
                .Weight = xlThin
                .ColorIndex = xlAutomatic
            End With
            
            For i = start To finish
                ActiveSheet.Rows(start).Delete
            Next
            Range("A2").Select
            ActiveSheet.Protect Password:=Pass
            
            frmMain.Show
            
        End If
Keep getting an error saying 'Invalid Property Value'? any ideas?

Hello,
I’ve several TextBoxes and ListBoxes linked to named cells in my
registration form.
Everything worked fine but suddenly when initiating the form I get the error
380: “Could not set the ControlSource property. Invalid property value.”
It doesn’t matter how I’m referencing to the cell in ControlSource, with a
variable, with the cell Name, with the cell range, the error pops anyway.
It seems like any value or string in the controlsource cell triggers the
error.
It happens to OptionButtons as well. A True or False value in the cell …Poff!

But as said, it was working before! Does ControlSource get “contaminated”
with usage? I tried with VBACleaner as well but it didn’t help very much. I
got other strange errors instead. (I could get the form to work if I opened
the workbook from within Excel, but if I started Excel with the
workbook-shortcut it didn’t work + other strange errors like not loading
startup files.)

A part of the code looks like:

Dim MD, RecOrder, RecDate, DelTime, CompIX, WHAT
Public Sub Userform_Initialize()
Sheets("DocSys").Activate
Set MD = Worksheets("DocSys") ‘ Main Document
Set CompIX = MD.Range("CompIX")
Set WHAT = MD.Range("WHAT")
Set RecOrder = MD.Range("RecOrder")
Set RecDate = MD.Range("RecDate")
Set RecDate = MD.Range("DelTime")

TextBox5.ControlSource = MD.Range(“A4”)
TextBox6.ControlSource = RecOrder
TextBox7.ControlSource = MD.Range("RecDate")
TextBox8.ControlSource = “DelTime”
OptionButton1.ControlSource = WHAT
With ListBox1
.ColumnCount = 2
.ColumnWidths = "0;72"
.RowSource = "Database"
.ControlSource = CompIX
.BoundColumn = 0
End With

What has happened? It’s very problematic to have empty cells as other
formulas are depending on an index value set by f.i. the ListBox. Errors in
these formulas triggers “Type Mismatch” instead.

Can anybody come up with a good solution?
Regards
Mats

Hello guys,

This is my first post here, and I'm wondering if anyone can help me.

I have a simple excel form with a combo box whose MatchRequired property is set to True.

I would like the user to receive a more user-friendly message than the "invalid property value" that comes as standard, but I don't know how to trap the error because I don't know which event is firing when the error occurs - I've tried my error handler in the "Before Update", "Exit" and a few other events associated with the combo box, but to no avail.

Can anyone suggest a solution?

Thanks,

Tim

I have a ComboBox that requires the user selects an item from the list (if anything else snuck in it would cause unspeakable horrors, this must be moronproof) so I set the MatchRequired property to TRUE. The problem is the rediculous error that would confuse the user as I anticipate the user will be a beginner of the most primitive kind.

How can I change the error message from "Invalid property value." to something more obvious like "Select from the list, IDIOT!" (just an example, my message will not be quite that angry)? While I'm at it, the error box's standard title of "Microsoft Forms" would be better off as something custom as well.

I am aware of changing the Style to require someone to actually pick from the list with no option of typing but this in itself is a problem as the list has 486 entries which all start with one of three values and are a combination of letters and numbers that cannot truly be put into alphabetic/numeric order and be at all simple to find.

ex: (all start with P, T or M but have random characters following)
P413MT12
P2175F34
PH12367L
T690UD0
T3D541
TG45CV
M402M43
MDF348R
M98G98L
etc...

So my only solution I think would be to find a way to change that error message (and error box title). Can it be done, and how?

Thanks in advance!

Following code works on another machine, not on mine

Private Sub CommandButton1_Click()

Dim r, c As Integer
Dim x As String

r = 4
c = 4
x = "TEST"

With Me.Controls.Add("Forms.TextBox.1")
.Left = 10
.Top = 30
.Width = 30
'.Value = "Leeg"
.ControlSource = "G7"
.ControlSource = Sheets(x).Cells(r, c)

End With
End Sub

I get a runtime error 380 : Could not set controlsource property. Invalid property value

Hi everyone,

I was wondering what the maximum number of columns is that one is allowed to use in a listbox. I was trying to put 16 columns in a listbox by using the property column count on the listbox. 7 of these 16 I wanted to have hidden by setting the columnwidth to 0. The reason for this is that I want to display all 16 values in another form after the selection in the listbox. Since I've managed to get 10 of the 16 values working the way I want and then I get "Error 380 - Not possible to set Property List. Invalid property value" (translation from my first language since I don't use Excel with English version) I'm trying to figure out is there a limitation or is there just something wrong with my code?

I have a form with 2 listboxes on it. When the form is initialized, I populate the first listbox, then, based on what the user selects in that listbox, I want to populate the 2nd listbox.

First list box is populated:

Code:
Private Sub UserForm_Initialize()

Set WINGS = Range("H2:H4")
listWings.List = WINGS.Value

End Sub
Command Button to get what the user has selected and populate the 2nd listbox:

Code:
Private Sub CommandButton1_Click()
strWing = listWings.Value

If strWing = "A" Then
    Set ROOMS = Range("K2") & Range("K4")
    listRooms.List = ROOMS.Value
End If

If strWing = "B" Then
    Set ROOMS = Range("K3")
    listRooms.List = ROOMS.Value
End If

End Sub
I am unable to get the 2nd listbox to populate no matter which if statement passes, due to this error:
Run-time error '381': Could not set the List property. Invalid property array index.

What am I missing??

Hello and Help:

I wrote VBA code (Excel 2000 SR1) which connected UserForms with
textboxes to worksheet cells. In a moment of insanity, I decided to
also convert this to VB6. Now, after successfully getting an existing
Excel Workbook, the ControlSource property is problematic except
possibly for those cells which were originally null. The Error
encountered is that Could not set the ControlSource property. Invalid
property value. Do I need a different syntax for referring to a
Worksheet Cell? There are no spaces or other unacceptable characters
in the sheet name. Am I inheriting a restriction? These are UserForms
in the Designer Folder of vb6. They are not VB6 Forms.

As an example:

frmInputCompletion.txtWHwrtRT.ControlSource = xlSheet.Range("C3")

gives an error.

Any help would be greatly appreciated.

Sincerely

John M.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Hi all

Im trying to se the controlsource property for a series of text boxes
I have created on a user form. Im doing this by going to the
properties of the text box and inseting the cell reference of the cell
I want it linked to

Every time I try (and ive tried a few variations) I get "could not set
the ControlSource property. Invalid Peopery value" error

i have tryed the following format all with the same outcome

sheet3!c3
Sheet2!"c3"
=sheet3!c3
=sheet31"c3"

can any one tell me the correct form for entering the control source

Cheers

Ian

If MsgBox("Do you wish to use the Master SubContractor/" _
& "Suppliers" & vbNewLine & "trade reference codes, or" _
& "rename them again?", vbYesNo) = vbYes Then
Call DataStoreCodes(wkbkname)
Else
frmName_Contractors.lbDataCode.List = _
Workbooks(wkbkname).Worksheets _
("DataStore").Range("G1", "G" & Rows.Count).Value
With Workbooks(wkbkname).Sheets("DataStore")
.Unprotect
.Range("G1", "G" & .Rows.Count).ClearContents
End With
End If

frmName_Contractors.Show

If user choses Yes, then all is fine. The sub 'DataStoreCodes'
loads col1 in the listbox of frmName_Contractors.Show
with all the codes in the user's workbook, and then checks them
against a sheet (MasterDataStore) in an addin. If the code is in the
addin, then it's loaded into Col2 in the listbox against the relevent
item.

If user chooses No, then I cannot get it to work.
The range is correctly added into Col! of the listbox, and when the
form displays, Col2 is (correctly) empty of values.
At this point user should be able to click on a Col1 entry then go
to a textbox where they type the corresponding Col2 value.

Doing this gives an error:
"Could not get the Column property....Invalid argument"

Here is the form code:

Private Sub lbDataCode_Click()
If lbDataCode.ListIndex -1 Then
If lbDataCode.Column(1, lbDataCode.ListIndex) "" Then
tbCtrTrade.Text = lbDataCode.Column(1, lbDataCode.ListIndex)
tbCtrTrade.SetFocus
tbCtrTrade.SelStart = 0
tbCtrTrade.SelLength = Len(tbCtrTrade.Text)
Else
tbCtrTrade.Text = ""
tbCtrTrade.SetFocus
End If
Else
tbCtrTrade.Text = ""
End If
End Sub

Private Sub tbCtrTrade_AfterUpdate()
If lbDataCode.ListIndex -1 Then
If tbCtrTrade.Text "" Then
lbDataCode.Column(1, lbDataCode.ListIndex) _
= tbCtrTrade.Text
End If
End If
End Sub

How may I amend this code, please?.

Regards.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.528 / Virus Database: 324 - Release Date: 16/10/2003