D
Derek
In Outlook 2000 I have created a form that opens, builds
a list (in UserForm_Initialize) and displays the list in
a combo box.
If the list is empty I would like to display a message to
that effect (no problem!) and then close the form without
it being displayed.
This is the code I have written ...
Private Sub UserForm_Initialize()
' Perform the appropriate initialise routine
' according to the selection type.
Select Case g_intSelectType
Case c_intCategory
DoCategory
Case c_intParent
DoParent
Case c_intLocation
DoLocation
Case c_intNames
DoNames
End Select
' If there are no items to select from (except
' Categories), display an error and close the form.
If cmbItems.ListCount = 0 Then
Select Case g_intSelectType
Case c_intParent
MsgBox "No documents available."
' CODE TO CLOSE FORM HERE?
Case c_intCategory
' Do nothing
Case Else
MsgBox "No items to select."
' CODE TO CLOSE FORM HERE?
End Select
End If
End Sub
How do I do that?
Thanks,
Derek.
a list (in UserForm_Initialize) and displays the list in
a combo box.
If the list is empty I would like to display a message to
that effect (no problem!) and then close the form without
it being displayed.
This is the code I have written ...
Private Sub UserForm_Initialize()
' Perform the appropriate initialise routine
' according to the selection type.
Select Case g_intSelectType
Case c_intCategory
DoCategory
Case c_intParent
DoParent
Case c_intLocation
DoLocation
Case c_intNames
DoNames
End Select
' If there are no items to select from (except
' Categories), display an error and close the form.
If cmbItems.ListCount = 0 Then
Select Case g_intSelectType
Case c_intParent
MsgBox "No documents available."
' CODE TO CLOSE FORM HERE?
Case c_intCategory
' Do nothing
Case Else
MsgBox "No items to select."
' CODE TO CLOSE FORM HERE?
End Select
End If
End Sub
How do I do that?
Thanks,
Derek.