Hiding a record in a form dropdown

  • Thread starter Thread starter Eric G
  • Start date Start date
E

Eric G

A2K.
I have a table called Reasons that has three permanent records in the
Reason field. Currently when the Reason control is tabbed to in the
entry form and a key is pressed, Me.Reason.Dropdown is activated and a
dropdown of three choices is presented.

How can I hide the third record of the Reasons table, so that only the
first two will show in the Me.Reason.Dropdown ?
Or better still, just present two Reasons, so the user can't
accidentally select the blank, hidden reason.

TIA Eric
 
Will, I suppose the solution is to simply remove the 3rd record.

However, you can also open up the combo box in design mode, and change the
sql for the combo box to not show, or not include the 3 record.

So, just add some code to the sql that the combo is based on, that condition
can simply eliminate the 3rd record.
 
Hi Albert,

I could remove the third record, but would I still be able to use a
query that throws in a value for the field, if the value is not listed
in the table's records?
So, just add some code to the sql that the combo is based on, that condition
can simply eliminate the 3rd record.

Where/how exactly would I do this? The combo isn't based on a query.
It's just pulling up a list of three possible values from the Reasons
table.

TIA Eric
 
Eric G said:
Hi Albert,

I could remove the third record, but would I still be able to use a
query that throws in a value for the field, if the value is not listed
in the table's records?


Where/how exactly would I do this? The combo isn't based on a query.
It's just pulling up a list of three possible values from the Reasons
table.

Oh, but it is using a query. Even when you have a RowsSource that is just the
name of a query or the name of a table, a query is still executed (in the
background) to get the data. Just click on the build button [...] to the right
of the RowSource property. This will take you to the query design tool where
you can add a criteria to NOT include the third value.
 
Back
Top