By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,694 Members | 2,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,694 IT Pros & Developers. It's quick & easy.

Auto Populating field

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a

Geoff Portbury wrote:
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


sure. set up your combobox to have 4 columns with a rowsource like
this:
SELECT SwimmerID, FirstName & " " & LastName AS Swimmer, FirstName,
LastName"

then hide the first column. (columnwidths: 0;1)

then set your two fields
FirstName = cboSwimmer.Column(2)
LastName = cboSwimmer.Column(3)
columns are zero-based collections, so the first column is column 0.

Nov 13 '05 #2

P: n/a
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.Column(2)
Me![Last Name] = Me!SwimmerID.Column(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******@pcdatasheet.com
www.pcdatasheet.com


"Geoff Portbury" <gp*******@dodo.com.au> wrote in message
news:41******@news.comindico.com.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

Nov 13 '05 #3

P: n/a

Thanks for the help. I'll give it a go.
As for setting the Db up quite differently, well you're no doubt right
but I have no training whatso ever and only progressed as far as this by
reading MS-Access help.

Geoff P.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #4

P: n/a
If you are need of a "better" database, I am in business to provide
customers with a resource for help with Access, Excel and Word applications.
My fees are very reasonable. Contact me at my email address below.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Geoff Portbury" <gp*******@dodo.com.au> wrote in message
news:41**********@127.0.0.1...

Thanks for the help. I'll give it a go.
As for setting the Db up quite differently, well you're no doubt right
but I have no training whatso ever and only progressed as far as this by
reading MS-Access help.

Geoff P.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #5

P: n/a

I've tried this suggestion four times being very carefull to follow the
instructions to the letter.
The result is a Combo box that displays the first entry in my Lastname
field over and over again.
I ran Debug and the first line of the added code is highlighted.
Any suggestions?

Geoff P
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.