Pop up To confirm combo box selection

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!
 
K

Klatuu

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
 
I

idtjes3

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top