ReUse Default Value with Combo Box

B

bw

Question: How do I make the Combo Box display the default value after I
click on the Combo Box?
I posted this question earlier, but found that I had made my question too
confusing.

I have an unbound Combo Box with the name "cboCancelFlight".
When the form is opened, the Combo Box displays the default value "Select a
Flight".

When I click the Combo Box to select a value, the following procedure is
executed:

Private Sub cboCancelFlight_Click()
Dim ans
ans = MsgBox("Are you sure you want to delete Request Number " &
CancelFlight & "?", 36, "Be Sure")
If ans = vbNo Then
' This is where I want to have the Combo Box again display the defalue value
"Select a Flight".
Exit Sub
End If
End Sub

The RowSource for cboCancelFlight is as follows:

SELECT DISTINCT tblSelectMainReport.RequestNum
FROM tblSelectMainReport
WHERE (((Nz([RequestNum],0)) Between 1 And 10));
 
T

TonyT

bw,
It looks like you should move that code from On_Click to after_update, as
that will stop the user getting any message if they select 'cancel flight'
(ie back out).

Is 'cancel flight' an entry in your table tblSelectMainReport? or does
combobox cboCancelFlight only have it's rowsource set at point of got_focus
or enter?

TonyT..
 

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

Similar Threads

Reuset the Default Value 7
Fill Lookup Table 2
Combo Box On Click 8
cascading combo help 3
Update Combo Box 4
Need help cascading 5 combo boxes 12
Combo Box Null 1
combo box 2

Top