Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello All,
{Excel 2007, PC, novice} I have a userform which contains a ComboBox showing the bound column data. It supplies two Text boxes with data from the two columns not shown. ----'Text Box Values will reflect Credit Card Choice Private Sub cmb_Purch_CreditCard_Change() txt_Purch_SecCode = Me.cmb_Purch_CreditCard.Column(1) txt_Purch_CodeLoc = Me.cmb_Purch_CreditCard.Column(2) End Sub ====================================== The ComboBox Enabled property is set to False ,and the row source is set to a range on a lookup sheet - only to be activated when the user chooses the Credit Card method of payment. This allows Credit Card related info to be visible and data to be entered into other text boxes. ----'Activate Credit Card ComboBox Private Sub cmb_PaymentMethod_Change() If cmb_PaymentMethod.Value = "CC" Then cmb_Purch_CreditCard.Enabled = True cmb_Purch_CreditCard.BackColor = &H80000005 Else: cmb_Purch_CreditCard.Enabled = False cmb_Purch_CreditCard.BackColor = &H8000000B End If End Sub =================================== Adding the data to the spreadsheet works fine (relevant code shown):. ----'Payment Methods ..Cells(lRow, 24).Value = Me.cmb_PaymentMethod.Value ..Cells(lRow, 25).Value = Me.cmb_Purch_CreditCard.Value ..Cells(lRow, 26).Value = Me.txt_Purch_SecCode.Value ..Cells(lRow, 27).Value = Me.txt_Purch_CCExpire.Value ================================================ When I run a Command button to ‘Clear Form’ but not close the form, I receive a ‘Runtime error 381’ Could not get the column property. Invalid property array.’ The button and the code are located on/in the user form, not in a module Rather than flowing through this code in the Sub for ‘Clear Form’ (relevant code shown): ---'Clear Payment Methods cmb_PaymentMethod.Value = "" cmb_Purch_CreditCard.Value = "" txt_Purch_CCExpire.Value = "" txt_Discounts.Value = "" txt_Notes.Value = "" The code jumps out and goes to the second line of the other Sub routine: ---'Text Box Values will reflect Credit Card Choice Private Sub cmb_Purch_CreditCard_Change() txt_Purch_SecCode = Me.cmb_Purch_CreditCard.Column(1) txt_Purch_CodeLoc = Me.cmb_Purch_CreditCard.Column(2) End Sub Does this need to be in the module for intializing the form? I'm learning this as I go along, but I’m at a loss trying to figure this one out. Any ideas? Thanks! Mark Mace |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime error 380 - Could not set the list property. Invalid property value. | Excel Programming | |||
Runtime Error 380 – Could not set the list property. Invalid property value | Excel Programming | |||
Runtime error 380: Could not set the List property. invalid property value of listbox | Excel Programming | |||
Runtime Error 381 Couldn't set list property, invalid array index | Excel Programming | |||
Runtime Error 381 Couldn't set list property, invalid array index | Excel Programming |