Discussion Locked

Access 97 Problem

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am trying to have a form in Access 97 to be linked to my one table. I want to be able to have 2 text boxes where you can either enter a users full name or his initials. Which ever you choose, the other text boxes linked to the other various fieldsin my table bring up the correct information for that username you enter. Does anyone know how to do that?

7 replies

by glen_mcleod

The easiest way of doing this is to use a criteria form, then open the main form from this one using a constructed criteria string as the form's Filter property ("EmployeeName = " & txtName)(or the Initials field). That way you can bind the table to the main form, but use the Filter property to give you the results of the search.

Glen

by suzannei

1) Create a combo box with enough columns to hold all the information you want to include on the form, such as user name, initials, title, department, etc. Set the width of all columns except the user name and initials ones to 0". (You can do this all with the combo box wizard.)

2) Next, create an unbound text box for each piece of information you want to display (title, department, etc.). Set the Control Source property of each text box to the appropriate column in the combo box, e.g.

=[cmbUsers].[Column](3)

which would display the text in the 4th column of the combo box.

Keep in mind that this is basically for display purposes, as none of these text boxes are bound to the table.

Feel free to ask me if you have any questions on this.

by donq

Cool answer Suzanne - I never tried that because I always wanted to enter or edit data through my forms.

Base your Form on a query (Form's Record Source property should be the query name).
To make everything editable verify/set the Recordset Type property to "Dynaset".

When you have multi-tables remember the child field you want to edit MUST be on your form and not a Foreign Key equivalent from a referenced table.

Then build a combo box much like Suzanne did and enter a requery command to its "After Update" event to populate everything that is pre-defined, or produce a clean slate for new entries.

Have fun! Don Quigg

This discussion is closed to new replies.