473,549 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Populate Some Fields from Other Table Primary Key

Hi,

I would need some help here:

I have two tables, Patient (parent table) and Service (detail table).
Composite primary key for parent table is (fname, lname, pid), while
composite primary key for detail table is (service date, pid). pid is the
linked relation between 2 tables.

On openning form from detail table, I want a lookup from pid from parent
table, then populate fname and lname of parent table onto detail table, or
just show somewhere on the form screen.

What I have got is to get pid lookup value from parent table, but not sure
how to make it automatically to fill up fname and lname with the same value
associated with pid from parent table.

Any quick thought will be greatly appreciated.

Ste
Apr 10 '07 #1
1 1831
On Apr 10, 5:44 pm, "Steven" <sche...@verizo n.netwrote:
Hi,

I would need some help here:

I have two tables, Patient (parent table) and Service (detail table).
Composite primary key for parent table is (fname, lname, pid), while
composite primary key for detail table is (service date, pid). pid is the
linked relation between 2 tables.

On openning form from detail table, I want a lookup from pid from parent
table, then populate fname and lname of parent table onto detail table, or
just show somewhere on the form screen.

What I have got is to get pid lookup value from parent table, but not sure
how to make it automatically to fill up fname and lname with the same value
associated with pid from parent table.

Any quick thought will be greatly appreciated.

Ste
Try this for starters
base your detail table on a query that has as criteria ie [Forms!
your_form!your_ Textbox] where your_Textbox holds the criteria for the
query field

Apr 11 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
12829
by: godber | last post by:
I need to populate text boxes for instance with employee information using their unique employee works number selected from a combo box. Can anyone help, I am told thru visual basic this can be achieved.
3
2203
by: PC Datasheet | last post by:
Using code in MyDateBase I create a new database named MyNewDatabase. Now I need to import (or export) using code in MyDatabase tables in another external database named MyData to MyNewDatabase. Is there a way to do it? What is the code? Thanks, Steve
1
3672
by: John Phelan-Cummings | last post by:
I'm not certain if this made the post. Sorry if it's a repeat: Using a Button to take an autonumber from one form to populate another autonumber field on another form. I have a Mainform "A" with a button and code that opens another Mainform "B" with a subform which has the same table as Mainform "A". The button is supposed to tell the...
5
17669
by: joshua.nicholes | last post by:
I have an access database that consists of two tables.A data collection table and a species list table. The data collection table has about 1500 records in it and the species list has about 600. The species list has 7 fields the first is a four digit unique identifier (species) it is set as the primary key. I have created a relationship to...
3
5312
by: Markw | last post by:
I think this was recently asked but I was a little lost on the example that was used so I'm reasking it with an example I can understand. Also forgive me for such a basic question but I really am new to Mysql and PHP. In the book "Build Your Own Database Driven Website Using PHP & Mysql" by Kevin Yank, they give an example for when using a...
1
1748
by: KMEscherich | last post by:
Using Access '97 Hi there, am wondering if someone can please help me with the following: I have a master table (T_INVESTIGATION) that contains the following fields as well as other fields. T_INVESTIGATION LOC_CODE, STR_ADDR, CITY,
7
9764
by: jthep | last post by:
Hi, I'm a newbie at this but how can I populate a table with data from other tables by using INSERT statements? Below is of what I have so far, I have to populate the PERSON_PROFILE table. I've tried using INSERT with SELECT and UPDATE commands which just dont work. I cant input data in one column at a time either since when I created the...
3
2722
MattFitzgerald
by: MattFitzgerald | last post by:
My Forms & Tables:- Main form is Frm_LE_List (contains Customer Details) Stored in Tbl_LE_List Which contains subform Frm_VOL_References (Contains Orders known as VOL's) Stored in Tbl_VOL_References This subform has subform Frm_Order_Lines (Contains line items for orders) Stored in Tbl_Order_Lines I also have a table Tbl_Rate_Card_Lookup...
11
3113
by: BeckR | last post by:
Hello - Thanks for reading my post. I am a newbie when it comes to VBA programming, but have managed to do what I need to do, until now. I have an Access 2000 database (running WinXP Pro (SP3)). I have successfully created 3 recordsets in my database. What I need to do is to take the data from those 3 recordsets and put them into a...
0
7461
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7730
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7971
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7491
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5101
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1068
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.