Msgbox and DoCmd

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

Guest

I have a dialog box that prompts the user to select parameters for the
underlying query via a combobox. Currently the default value of the combobox
is "Choose Entity and Period" and if the user does not choose from the
dropdown choices a messagebox tells the user to choose. But after the user
makes a choice and clicks the button to execute a macro the database locks up
and you have to exit. I used the following code:

Private Sub fedprovpre_Click()

If Me![cbo_IDPrint] = "Choose Entity and Period" Then
MsgBox "Choose Entity and Period from dropdown box!", , "Wait a
second!!!"
Else
DoCmd.RunMacro "mcr_4a Preview Federal Provision"
End If

End Sub

Help?
 
Tim,

I gather from your post that you correctly get the message box if the
user does not select an item from the list, and the default entry
remains. So the problem arises when another item is selected in the
combobox. Right? Therefore, it would lead me to suspect that the
problem is caused by the macro, and not directly by the code you posted.
Can you give more details of the 'mcr_4a Preview Federal Provision'
macro... all actions and relevant arguments?
 
Back
Top