Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically entering data into a field on a form

Status
Not open for further replies.

clackl

Technical User
Joined
Nov 6, 2002
Messages
14
Location
GB
I have a database that keeps various sets of information about my clients. The unique identifier for each client is used to link up these sets of data, which are held in seperate tables. So for example I have a client demographic form which has several control buttons that then open other forms linked on the client id number.

What I would like to be able to do is to have the database automatically enter the client id number from the demographic form into the client id number field on the new linked forms. Is there a way of doing this?

Many thanks
 
If you are using bound forms, and have a query that links the fields together as the record source for the form, this should be done form you almost automatically.....If you would like an example, send me an email to the address in my sig block and I will forward one to you... Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! [thumbsup2]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Literally the answer must be NO
because you form does not have any fields on it.

FIELDS are found in TABLES
CONTROLS are found on FORMS

Can you do what you want though ?
Yes there is a way,but WHY in the name of all that is all "Relational" would you want to do this ?


Although you haven't explicitly said so, it seams that you have multiple tables with a one-to-one relationship between them. - Is this true ?

One-to-one relationships are oftern a sign of bad ( ill thought out ) design.
If the data has a 'relation' to the primary key in the ClientDemographic table then store the data in the ClientDemographic table.

You can then have a form that simply allows the user to see just the 'Demographic' data.
From there you can open another form bound to the same table that has access to other (say contact details) data. You then have no need to fill in any controls because the data is already there.



'ope-that-'elps.


G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.

Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! :-D

 
Thanks for these comments. In fact I obviously didn't make it quite clear enough, most of the tables are jointly linked on client id and date, as we hold more than one entry for each client in the related tables/forms. So they are one-to-many relationships. However it is just the client id that I would like to automatically input if possible.

 
Wow! Imagine what reading the whole post can do for the brain pan??? [smile] LittleSmudge is right, I was looking mostly at the title and going on this. If you just want to open each form and make sure it has the Id of the client in the Id field, that can be done. But perhaps you should provide some of you database layout.....typicall example is:

Table1
Field1 (PK) DataType
Field2 DataType
Field3 DataType
.
.
.

Table2
Field1 (PK) DataType
Field2 (FK) DataType
Field3
.
.
.

This way we can evaluate the setup and maybe push you down the right fork in the road. Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! [thumbsup2]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Mostly the layout would look something like this:

Table 1

Client ID (PK) Number
Firstname Text
Surname Text
Address1 Text
_
_
_


Table 2

Client ID (PK) Number
Date (PK) Date/Time
Contactname Text
Problem1 Text
_
_
_

However some of the tables need to generate their own ID number as there may be more than one entry for any given day. So then the layout would look more like this.

Table 1

Client ID (PK) Number
Firstname Text
Surname Text
_
_
_
_

Table 2

Telephone no (PK) Autonumber
Client ID Number
Date Date/Time
Contact name Text
_
_
_


Thanks for your help with this.
 
Send me an email and I will send you a db that may be similar to what you are looking for. Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! [thumbsup2]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
Have a look at this thread - I think it has something that will be of use to you.

thread702-391687 G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.

Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! :-D

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top