Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Craig Daniels   on Sep 21 In MS Office Category.

  
Question Answered By: Fannie Gonzales   on Sep 21

The ProcessData Sub doesn't require the form  to be open otherwise
the code  wouldn't work  when i step through it in isolation, yes?
Anyhow, it falls over before it gets to the ProcessData call. Would
simply changing the forms ShowModal property to False correct this?

The issue is with setting the rowsource for a combobox. The userform
contains a MultiPage control with four pages. The first page has
four OptionButtons and a CommandButton. Depending on which
OptionButton is selected, the RowSource of a combobox on the second
page is set to one of a number  of Named Ranges. This assignment is
handled by the code behind the CommandButton, which (Cut&Pasted!) is:

Private Sub cmdNext1_Click()
If Me.opt1 = True Then
Me.cboA.RowSource = Range("One").Address
End If
If Me.opt2 = True Then
Me.cboA.RowSource = Range("Two").Address
End If
If Me.opt3 = True Then
Me.cboA.RowSource = Range("Three").Address
End If
If Me.opt4 = True Then
Me.cboA.RowSource = Range("Four").Address
End If
Me.MultiPage1.Value = Me.MultiPage1.Value + 1
End Sub

However, when the form is displayed using the frmCaptureInfo.show
the assignment fails with the Run Time Error 1004 : Method 'Range'
of object  '_Global' failed. Hovering the mouse over the .Address
section doesn't show the range  of the Named Ranges as I expect.
Doing this when I step through the code manually displays the cell
references of the assigned named range.

Does that help  any?

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Problem with calling Sub from UserForm Or get search suggestion and latest updates.


Tagged: