Search code examples
ms-access-2007

Display only two fields from Access table


New to Access here... I asked a similar question the other day, but have a new twist for a different form I am creating.

Say I have a table (tblNamesAndValues) that looks like this:

Name        Value
----        ----

Mary        100
Carrie      500
Terri       999
Gerrie      749

I have created a form that displays all four names and values.

My question is this: how can you make the form display only the names Mary and Terri and their values, and have the values in updateable textboxes? On top of that, is there any way to only display those two, and not the blanks underneath that allow new entries?

Thanks in advance...


Solution

  • You can filter the form or use a query instead of the table as table source:

    select * from tblNamesAndValues where name = "Mary" or name = "Terry"
    

    For disabling the blank line, just set the AllowAdditions property of the form to false.