ok here's a solution.. not too neat, but hopefully will be what you are after.
change the property ShowDropButtonWhen to fmShowDropButtonWhenNever
then have the following code
Private Sub cmbRecipeSelect_GotFocus()
Dim stMsg As String
Dim intResponse As Integer
If intCounter = 0 Then
cmbRecipeSelect.DropDown
Else
stMsg = "Are You Sure You Want To Change Recipes?" & vbCrLf & vbCrLf _
& "You Will Loose All Changes Unless you Write Them To The Database First!"
intResponse = MsgBox(stMsg, vbYesNo, "Are You Sure?")
If (intResponse = vbYes) Then
cmbRecipeSelect.DropDown
End If
End If
not sure if this is no a form, or just on an excel sheet.. but should hopefully work.. you may have to play with moving the focus away from the combobox if you say no to the question.. Hope this helps
|