ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Keep User Form Active (https://www.excelbanter.com/excel-programming/398078-keep-user-form-active.html)

Brian

Keep User Form Active
 
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,
--
Brian McCaffery

joel

Keep User Form Active
 
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.

"Brian" wrote:

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,
--
Brian McCaffery


Bob Phillips

Keep User Form Active
 
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)

"Brian" wrote in message
...
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,
--
Brian McCaffery




Brian

Keep User Form Active
 
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,

--
Brian McCaffery


"Joel" wrote:

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.

"Brian" wrote:

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,
--
Brian McCaffery


joel

Keep User Form Active
 
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.

"Brian" wrote:

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,

--
Brian McCaffery


"Joel" wrote:

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.

"Brian" wrote:

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,
--
Brian McCaffery



All times are GMT +1. The time now is 10:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com