Keep User Form Active

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

All,

I have managed to get my mini document configuration management tool running
thanks to all the help I have received here.

I have one problem I haven't been unable to resolve. When I select from the
combobox, it searches the data base for all related documents\references and
writes to the report sheet. However, it also closes the userform. How can I
keep the userform in focus?

Thanks,
 
You prpbably have either a useform.hide or a unload userform someplace in
your code that has to be removed. Check your combobox change function for
any statements jusing the userrform methods.
 
Post the code and see if we can spot it.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Joel,

Thanks for the response. I can't find a userform.hide or unload anywhere.

The code is a series of case statements. The code below shows only one.

Private Sub ComboBox1_click()
Dim i As Long
Dim rng As Range
Dim refrange As Range
Dim c As Range

ComboBox2.ListIndex = -1
ComboBox4.ListIndex = -1
ComboBox5.ListIndex = -1

Select Case ComboBox1.Value
Case "GSOP_0286"
Sheets("Report").Range("A4:I20").Clear
Set refrange = Sheets("Sheet2").Range("A3:A20")
i = 0
For Each c In refrange
If c.Value = "" Then
End
Else
s = Replace(c.Formula, "=", "")
Set rng = Evaluate(s)
rng.EntireRow.Copy
Sheets("Report").Range("A4") _
.Offset(i, 0) _
.PasteSpecial Paste:= _
xlPasteAll, _
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
i = i + 1
End If
Next c
End Select

Any thoughts?

Thanks,
 
Check the ControlSource in the combobox properties window for each of your
comboboxes. It is possible that this combobox is triggering a change in
another combobox and the 2nd combobox is closing the userform.


I would put a break point at the start of each combobox. Also break point
at each place the user form gets closed and see if you are getting to any of
these break points. Use the F9 key to put the break point into the code.
Then run the macro and see if any of the break point are reached.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top