Create a query named QrySwimmers based on your table Name ID. In the first
field, pull down Name ID. Type in the following in the second field:
Swimmer:[Last Name] & ", " & [First Name]
in the third field pull down First Name and in the fourth field pull down
Last Name. Set the sort on Last Name to Ascending.
In your Swim Times form, replace the textbox where you enter swimmers name
ID with a combobox. Select the combobox and open properties to the Data tab.
Use the down arrow at the right to set the Row Source property to
QrySwimmers. Set the Bound Column property to 1. Click on the Format tab.
Set the number of columns to 4 and set the column widths property to
0;2;0;0. Click on the Other tab and name the combobox SwimmerID. Click on
the events tab. Click in the AfterUpdate event box and then click on the
three dots at the right. In the dialog that appears, click on Code Builder.
The code page for your form will open and you will see two lines of code.
Type in the following code between those two lines:
Me![First Name] = Me!SwimmerID.Co lumn(2)
Me![Last Name] = Me!SwimmerID.Co lumn(3)
This code presumes the first name and last name fields on your form are
named First Name and Last Name. If different, type in the actual field
names.
Close everything and the open your Swim Wimes form. You will now be able to
select the swimeers rather than entering their code. When you make a
selection, you will actually be entering the swimmer's name id although you
see his name. The first and last names of the selected swimmer will
automatically be entered in the First Name and Last Name fields.
This will all work for you; however, your database should be set up quite
differently. Other things you might want to do with the database and
reporting are going to be difficult!
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com www.pcdatasheet.com
"Geoff Portbury" <gp*******@dodo .com.au> wrote in message
news:41******@n ews.comindico.c om.au...
I'm a swimming club coach.
I have a data base for recording times at various meets.
I have a FORM for entering times called SWIM TIMES.
When I enter the swimmers name ID, eg FOR01 for Doug Ford I want "Doug" to
populate the FIRST Name field and "Ford" to populate the Last Name field.
At present I have to manually enter them.
I have a table called Name ID in which I have stored the swimmers ID
numbers , first and last names in the following manner
Field-- Name ID (Primary Key). eg FOR01
Field-- First Name. eg Doug
Field-- Last Name. eg Ford
Information entered into the Swim Times form populates a table called
TIMES.
Can anyone understand this and help?
I have no knowledge of programming.
Geoff Portbury