populating fields

  • Thread starter Thread starter KIRSTEN
  • Start date Start date
K

KIRSTEN

I was wondering if someone could help me out. I am not a
skilled access user so I am looking for some stem by step
instructions.

I have two database tables.

The fist table is a list of names (first, middle, last)
that will need to be entered into the second database on a
regular basis. In other words this list of names will be
used as a pick list for the second database. This database
contains all the names that could go into the second
database.

The second database table will contain blank fields
consisting of first name, middle name, and last name.

I then have a form where a data entry steward will enter
the first name, middle name, and last name so it will
enter into the second database.

What I want to do is have the form set up so when the data
entry steward enters the last name it will automatically
fill in the first name and the middle name and record the
information in the second database table.

Any suggestions would be greatly appreciated. Thanks in
advance.
 
Normally it is not good practice to store names multiple times like you are
doing. A better design would be to give each name in your first table an ID
number. Then just store this ID number in your second table. You can
always use this ID number to determine the name and it won't store redundent
information. Having said that and assuming you really do want to do this.

Question? Are there names with a common last name? You said that after the
last name is entered, the other parts of the name will get automatically
entered. What would happen if there is more than one person with the same
last name. Assuming this situation will not happen, here are the steps.

- On your form, create 3 text boxes, 1 for each part of the name. Name
each box something you can easily remember. If you used the wizard to
create the form, the names will automatically default to the name of the
field from the table.
- Change the box for the lastname to a combo box. You can do this by right
clicking on the box, then selecting "change to", "combo box.". Again, right
click on this new combo box and select "properties".
- Click on the "data" tab. Then in "Row Source Type" select "Table/Query".
Then on "Row Source" select your table with the names. Then go bakc to "Row
Source" and click on the elipses (...) to the right of this field. A
message screen will come up, hit "Yes". This will bring up the query
builder window.
- Select the 3 fields for the 3 parts of the name in the order
"Last","First","Middle". Now close this window. A warning will come up,
select "Yes".
- Now find the "Event" tab. Click in the box next to "After Update" then
click on the elipses next to this box. A window will come up with 3
choices, pick "Code builder" then OK.
- A text editor type screen will appear. Whereever the cursor is type in
the following as separate lines.
[First Name]=[Last Name].Column(1)
[Middle Name]=[Last Name].Column(2)
- Change the names in the [ ] with the names of your boxes. Keep the [ ],
you'll need those.
- Go ahead and close this window and the form. Save your changes. Now when
you pick or type in a name and hit enter or tab in the last name combo box
the other 2 boxes should get filled in. If you have repeated last names,
the first name in the list will be used to fill in the other 2 boxes.

Kelvin
 
What I want to do is have the form set up so when the data
entry steward enters the last name it will automatically
fill in the first name and the middle name and record the
information in the second database table.

As Kelvin says, this is a very dubious design. I have three friends:
Fred Brown, his son Fred Brown, and an unrelated gentleman Fred Brown.
Which person's information would you store in the second table if you
picked Brown?
 
Back
Top