Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Could not set the List property. invalid property value of listbox

Status
Not open for further replies.

JasGrand

Programmer
Jan 8, 2003
144
CA
Hello, I get the error (when i get to the line which includes "Me.txtStreet.Value") in the title when i try to run the below code (which is in an excel 97 document)... and I can't see anything wrong with it... the "Me.txtStreet.Value" is equal to "Street A" any help is appreciated.

'// Add item to listbox
With Me.lstClientInformation
.AddItem strClientName '// Client Name
.List(.ListCount - 1, 1) = Me.txtFarmBusinessStableName.Value '// Farm/Business/Stable Name
.List(.ListCount - 1, 2) = strMailingAddress '// Mailing Address
.List(.ListCount - 1, 3) = Me.txtSalutation.Value '// Salutation
.List(.ListCount - 1, 4) = Me.txtFirstName.Value '// First Name
.List(.ListCount - 1, 5) = Me.txtMiddleInitials.Value '// Middle Initial(s)
.List(.ListCount - 1, 6) = Me.txtLastName.Value '// Last Name
.List(.ListCount - 1, 7) = Me.txtFarmBusinessStableName.Value '// FSB Name
.List(.ListCount - 1, 8) = Me.txtStreetNumber.Value '// Street Number
.List(.ListCount - 1, 9) = Me.txtUnitNumber.Value '// Unit Number
.List(.ListCount - 1, 10) = Me.txtStreet.Value '// Street
.List(.ListCount - 1, 11) = Me.txtAddress2.Value '// Address 2
.List(.ListCount - 1, 12) = Me.txtCity.Value '// City
Me.cboProvince.BoundColumn = 1
.List(.ListCount - 1, 13) = Me.cboProvince.Value '// Province ID
Me.cboProvince.BoundColumn = 2
.List(.ListCount - 1, 14) = Me.cboProvince.Value '// Province Name
.List(.ListCount - 1, 15) = Me.txtPostalCode.Value '// Postal Code
.List(.ListCount - 1, 16) = Me.txtPhone.Value '// Phone Number
.List(.ListCount - 1, 17) = Me.txtExtension.Value '// Phone Extension
.List(.ListCount - 1, 18) = Me.txtCell.Value '// Cell Number
.List(.ListCount - 1, 19) = Me.txtPager.Value '// Pager Number
.List(.ListCount - 1, 20) = Me.txtFax.Value '// Fax Number
.List(.ListCount - 1, 21) = Me.txtEmailAddress.Value '// Email Address

End With


Thanks,


Jason Grandmaison
 
What is the value of lstClientInformation.ColumnCount ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hello the value is set to 21.

Thanks,


Jason
 
Can anyone help please? I don't have a clue what the problem is...

Thanks again,


Jason
 
Sorry, the error is stating it is an invalid property value?

And it is ONLY that one textbox?

have you checked all the properties of the textbox itself to make sure everything is identical with the other textboxes? Nothing weird? Perhaps write down, property by property, a textbox that IS giving good values, and the one that is NOT.

It looks OK, but all I can see is that one line. Something is, obviously, not right with the textbox.

Just as an aside, are all these textboxes actually needed for user input? If they are not, and are picking up data from a source, you may want to consider using labels, rather than textboxes. If the user is not actually typing into the box, a textbox is not needed. Labels are better.

Gerry
 
Thanks for answering. All the textboxes were copied from a single textbox... so all the properties are identical. It's like my listbox isn't allowing more then 10 things to be inserted into it (column wise)... because when i comment out the one line and change the column numbers appropriately, i still get the same error... Any ideas?

Thanks,


Jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top