Required Values for Combo Boxes

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

Guest

I need the user to select values from three combo boxes before a complicated
calculation begins. Where do I put the code and message box to remind the
user that he must select each value before the calculation is processed.
The calculation code is in the "Calculate Return" command button on-click
event.

Values for ComboBoxes: AccountID, BeginDate, EndDate
 
If the calculation is done when the user clicks a button, the check belongs
there.

This kind of thing:

Private Sub CalculateReturn_Click()
If IsNull(Me.AccountID) Or IsNull(Me.BeginDate) Or IsNull(Me.EndDate)
Then
MsgBox "You must supply AccountID, BeginDate, and EndDate first."
Else
'do your calcuation here.
End If
End Sub
 
SharonInGa said:
I need the user to select values from three combo boxes before a complicated
calculation begins. Where do I put the code and message box to remind the
user that he must select each value before the calculation is processed.
The calculation code is in the "Calculate Return" command button on-click
event.

Values for ComboBoxes: AccountID, BeginDate, EndDate

Set the Enabled property of the ComboBox to No and then in the AfterUpdate event
of all three ComboBoxes have code similar to...

If IsNull(AccountID) _
Or IsNull(BeginDate) _
Or IsNull(EndDate ) Then
Me.CommandButtonname.Enabled = False
Else
Me.CommandButtonname.Enabled = True
End If

The user simply will not be able to press the button until all three ComboBoxes
are filled out.
 
Back
Top