Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I hope someone is able to help me with a logic problem.
I have this piece of code associated to a button click of a user form. When a certain condition exists, the user is prompted for a yes or no answer.
Answering yes opens up another userform. The user then selects information from that userform. Once that information has been entered, that userform closes, and then takes the user back to the original code before the second userform was opened to resume.
My issue is this ... when the second userform opens, the original code resumes without the user being able to first process that userform.
Green line is executed, test_mr initialization code is executed and the form is displayed populated. But instead of allowing the user to control that form, the original code resumes at the blue line. This cannot happen until the user has completed the necessary input associated with the 2nd userform.
What must I do to pause the original code until the second userform process has been completed?
I have this piece of code associated to a button click of a user form. When a certain condition exists, the user is prompted for a yes or no answer.
Answering yes opens up another userform. The user then selects information from that userform. Once that information has been entered, that userform closes, and then takes the user back to the original code before the second userform was opened to resume.
My issue is this ... when the second userform opens, the original code resumes without the user being able to first process that userform.
Rich (BB code):
With ws_data
'missing rental info?
ar = WorksheetFunction.CountIf(.Range("A:A"), "act")
pr = WorksheetFunction.CountIf(.Range("A:A"), "pass")
If ar + pr > 0 Then 'missing data still exists
ui1 = MsgBox("There is still missing rental information associated with this date." _
& Chr(13) & "It is highly recommended that this information be submitted before proceeding." _
& Chr(13) & "Unwanted behaviour or results may result by continuing." _
& Chr(13) & "Would you like to process these rentals now?", _
vbYesNo + vbCritical, "MISSING INFORMATION : Rental Data")
If ui1 = vbYes Then
df1 = 1
test_mr.Show
End If
End If
'assess rental mergers
duplicates (lmrg)
MsgBox lmrg & " record(s) merged.", vbInformation
Green line is executed, test_mr initialization code is executed and the form is displayed populated. But instead of allowing the user to control that form, the original code resumes at the blue line. This cannot happen until the user has completed the necessary input associated with the 2nd userform.
What must I do to pause the original code until the second userform process has been completed?