Pop up To confirm combo box selection

  • Thread starter Thread starter idtjes3
  • Start date Start date
I

idtjes3

Hello All,

I have a form that has a project status combo box were the user can
choose either in progress, on hold, or completed. I also have 2 text boxes.
One holds the projects price and the other holds a total of all the invoices
received to date.
I want to create a pop up warning so that if the user selects "complete"
for the project status and the full price of the contract hasn't been paid,
the pop up will ask " Are you sure you wish to set project status to
complete?". if they hit yes the combo box will read complete. If they hit no,
the pop up window will close.
This seems like its probably been done before so if anyone knows of a
tutorial anywhere I'm all ears. Thank in advance!
 
Use the Before Update event of the combo box:

Private Sub cboStatus_BeforeUpdate(Cancel As Integer)

If Me.cboStatus = "Complete" Then
If Me.txtInvoicesReceived < Me.txtProjectPrice Then
If MsgBox( "Are you sure you wish to set project status to
complete?", vbQuestion + vbYesNo) = vbNo Then
Cancel = True
Me.cboStatus.Undo
End If
End If
End If
 
Worked like a charm. Thank you very much Dave.


Klatuu said:
Use the Before Update event of the combo box:

Private Sub cboStatus_BeforeUpdate(Cancel As Integer)

If Me.cboStatus = "Complete" Then
If Me.txtInvoicesReceived < Me.txtProjectPrice Then
If MsgBox( "Are you sure you wish to set project status to
complete?", vbQuestion + vbYesNo) = vbNo Then
Cancel = True
Me.cboStatus.Undo
End If
End If
End If
 
Back
Top