PDA

View Full Version : Another Access question


Steve
10-05-2004, 01:25 PM
Frequently, after I've created a table with one or more lookup fields, with the values manually entered (typically fewer than five choices so I rarely create a linked table) and then created a form based upon that table, a user will ask that another value be added for the lookup.

So I go into the table and add it. Problem is I can't get the form to automatically detect the addition. I know how to go into the field properties on the form and add it, but it seems that once I've updated the table lookup values, the form should follow suit.

What am I doing wrong?

mikeky
10-05-2004, 04:33 PM
I don't believe the table lookup values and the form combo box source values are linked, it just happens to recognize that there is a values list when you add the field to a form and adds it for you. After that, updates are not tracked in either direction.

You could possibly add a custom function for the combo box Row Source Type to find what the field's Row Source values are in the lookup and use those in your combo box drop down list, but imagine it would be pretty intense to do. The easier way would be to simply create a separate table with the lookup values you want for the table field in question and use this for both the table and form combo box. Alternately, if the table field value of interest is limited to certain values and all the values are listed in the field, then you could use an SQL statement under the Row Source to pull out all the unique values and list them in the combo box, e.g.,

SELECT [your table name].[your field name] FROM [your table name] GROUP BY [your field name] ORDER BY [your field name];

Steve
10-05-2004, 04:57 PM
Ah, thanks mikeky, then I'm not doing anything wrong. Odd that it works that way, though.....Appreciate the hints, I'll keep them in mind if I get lengthy lists in the future. Much obliged!

Fast Loans | Loan | Online Advertising | Ondernemen | Secured Credit Cards