views:

47

answers:

4

Hi,

I have a SQL database where one of my fields 'Status' has one of 10 entries in it (not from a dropdown list). I let some people have access to the data through an Access database, they can add and modify entries.

My question is, in Access, how can I make it so that the 'Status' field is a drop-down list from which the users can choose from (the 10 entries which are already in the SQL database)? It would be easier for them and also mean that mistakes cannot be made.

Many thanks

Scott

+1  A: 

In Access you can add lookup information to a column. That will automatically display a dropdown list.

Step 1: Start the lookup wizard:

alt text

Step 2: After the wizard, the lookup settings should look like this:

alt text

Step 3: When your users open a table, they should see the dropdown box:

alt text

Andomar
Thank you for your very detailed reply but my problem is that the table I am using is a linked table from SQL so I cannot modify the design.
Scott Jackson
This is strongly deprecated by the Microsoft Access MVPs: http://www.mvps.org/access/lookupfields.htm
Remou
@Remou: Don't think there's an alternative for displaying a dropdown in table view. Anyway, the OP can't use this method, so he's saved from the evils of lookup fields :)
Andomar
Nobody should be using table view as a user interface object, except for quick-and-dirty editing. If you want a datasheet, create a datasheet form. Alternatively, you can create a lookup in a saved QueryDef, which will behave identically to a table datasheet.
David-W-Fenton
A: 

In addition to the solution described by Andomar you must not use another table as the source for your lookup. You can also provide the lookup-values in a list, which is hardcoded in the table-definition. This is fine for simple scenarios where the lookup is something that is not likely to be changed.

nyn3x
+1  A: 

The usual way to do this is to use a combo box on a form with the row source taken from the look-up table and the bound column set to the field (column) of the table to be updated.

Remou
A: 

Several issues here:

  1. table datasheets are not suitable user interface for users.

  2. you can create a saved QueryDef and if you view the properties of a field, the second tab is just like the second tab in table design, and allows you to use a combo box as your display type in your query. I would generally recommend against this, as, like table datasheets, a QueryDef is not a proper UI element, and if you use the saved query in other queries, you can run into the same problems that cause lookups in table fields to be such as bad idea.

  3. you're building a UI, so use the tools that Access provides you for building a UI. That means a form. Your form's recordsource would have the bare data, and you'd create a combo box on your form that is bound to the field in the table behind your form, and displays the values from the lookup tables. There's a wizard to step you through this. If you like the look of datasheets so much (column sizing, sorting, show/hiding are all features that are nice in datasheets), you can set your form to display as a datasheet.

My advice is that for building a user interface, use the tools Access provides for creating user interface. In my opinion, a dropdown list belongs in a form, and nowhere else. While I occasionally might add one to a query for quick-and-dirty editing, I would never do that in objects that users are going to use.

David-W-Fenton