combo dropdown

  • Thread starter Thread starter woja
  • Start date Start date
W

woja

Hi everyone,

I have a combo box FunderID that I want to drop down only if there is no
text in the field, and not to drop down if an entry has already been made.

My first approach was to let it drop down only if it was a new record
like this using the GotFocus event:
FunderID.setfocus
If Me.NewRecord Then
FunderID.dropdown
End If

This prevents the combo box from dropping down in other records. But
when the focus moves back to FunderID in the new record, even if an
entry has already been selected, it will drop down again.

I've tried this:
FunderID.Requery (there's another reason for this line)
FunderID.setfocus
If FunderID = "" Then
FunderID.dropdown
End If

Alternatively
If FunderID = Null Then
FunderID.dropdown

neither of these approaches work - no error messages, and the combo box
doesn't drop down when there is no entry.

Can anyone give me any clues?

Regards
Roger
 
You have to check for null values using a function. Something like this in
the GotFocus event (of the combobox).

If Me.FunderID = "" Or IsNull(Me.FunderID) Then
Me.FunderID.Dropdown
End If

HTH,

Neil.
 
Back
Top