A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Fill-up Data automatically



 
 
Thread Tools Display Modes
  #1  
Old February 13th, 2009, 09:20 AM posted to microsoft.public.access.gettingstarted
binary romel
external usenet poster
 
Posts: 9
Default Fill-up Data automatically

I have two tables.
School (sch_ID, sch_name, type, cluster, address, phone)
Teacher (tch_id, name, designation, sex, birth_date, join_date, education,
sch_id, sch_name, type, cluster)
I want when I type sch_id in Teacher table Access fill-up data in sch_name,
type and cluster field from School table automatically.
Pls help.

--
binary romel
  #2  
Old February 13th, 2009, 03:56 PM posted to microsoft.public.access.gettingstarted
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Fill-up Data automatically

One more time ... Access is not a spreadsheet. If you want to get good use
of Access' features/functions, do NOT try to feed it 'sheet data.

If you are already storing the [sch_id] in your [Teacher] table, storing the
[sch_name] is unnecessary and redundant.

Instead, use a query that joins the two tables on their common field
([sch_id]) and return the [sch_name] via your query.

(if you are trying to do this because you want to print out a report, use
the query to 'feed' the report)

Regards

Jeff Boyce
Microsoft Office/Access MVP


"binary romel" wrote in message
...
I have two tables.
School (sch_ID, sch_name, type, cluster, address, phone)
Teacher (tch_id, name, designation, sex, birth_date, join_date, education,
sch_id, sch_name, type, cluster)
I want when I type sch_id in Teacher table Access fill-up data in
sch_name,
type and cluster field from School table automatically.
Pls help.

--
binary romel



  #3  
Old February 13th, 2009, 06:06 PM posted to microsoft.public.access.gettingstarted
[email protected]
external usenet poster
 
Posts: 129
Default Fill-up Data automatically

Remove the sch_name and cluster fields from your Teacher table for the
reasons Jeff has explained. On your data input form for the Teacher
table add a combo box set up as follows:

Name: cboSchool

ControlSource: sch_id

RowSource: SELECT sch_id, cluster, sch_name FROM School ORDER BY
sch_name;

BoundColum: 1
ColumnCount: 3
ColumnWidths: 0cm;0cm;8cm

If your units of measurement are imperial rather than metric Access
will automatically convert them. The important thing is that the
first two dimensions are zero to hide the first two columns and that
the third is at least as wide as the combo box.

Now add a text box to the form and set its ControlSource property to:

=cbSchool.Column(1)

When you select a school from the combo box's drop down list the
school name will show in the control, but its underlying value will be
the sch_ID and this will be the value in the table. The text box will
show the cluster by referencing the hidden second column of the combo
box, the Column property being zero-based.

If you don't use forms for inputting data then create them. Never
input data directly into a table in datasheet view. You can use the
form wizard to create basic forms, then amend them in design view.

If you are creating a report in which you wish to show the teacher and
school data base the report on a query which joins the Teacher and
School table on the sch_id fields. You can then return the school
name and cluster fields from the School in the query (and any others
for that matter) along with the desired fields from the Teacher table.

Ken Sheridan
Stafford, England

On Feb 13, 9:20 am, binary romel
wrote:
I have two tables.
School (sch_ID, sch_name, type, cluster, address, phone)
Teacher (tch_id, name, designation, sex, birth_date, join_date, education,
sch_id, sch_name, type, cluster)
I want when I type sch_id in Teacher table Access fill-up data in sch_name,
type and cluster field from School table automatically.
Pls help.

--
binary romel


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.