Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Business Applications
Tag Cloud
access acer asus bios bsod computer crash desktop dns driver drivers error ethernet excel freeze gaming graphics hard drive hardware hdmi internet laptop malware memory monitor motherboard network printer problem ram registry repair router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: Access Form question

Reply  
Thread Tools
mrwendal's Avatar
Member with 382 posts.
 
Join Date: Jul 2001
Location: England
14-Apr-2009, 05:55 PM #1
Solved: Access Form question
Hi there,

In Access (2003) I have two tables similar to those listed below, in which the doctor table links to Practice table by PracticeID (i.e. in the example below, Drs Jones, Smith and Walsh are members of the Central Surgery).

Table 1 - Doctor
Fields: DocID, DoctorName, PracticeID
e.g.
1 - Dr Jones - 1
2 - Dr Smith - 1
3 - Dr Walsh - 1
4 - Dr Keegan - 2
5 - Dr Bob - 2


Table 2 - Practice
Fields: PracticeID, PracticeName
e.g.
1 - Central Surgery
2 - West Surgery


I have form which populates a third table, and in this I have a combobox which enables me to select a GP (and enters this in the third table). What I want to happen is for another field on the form to automatically show which Practice the GP belongs to, and for this to be entered in the table also.

I've spent ages on this and know it's a simple thing, but am stuck!
Please can someone point me in the right direction? Many thanks! )
__________________
Before you criticize a man, walk a mile in his shoes.... That way, when you do criticize him - you'll be a mile away, and have his shoes
slurpee55's Avatar
Computer Specs
Distinguished Member with 7,837 posts.
 
Join Date: Oct 2004
Location: Southwest Iowa....
Experience: Currently stupid...
14-Apr-2009, 06:13 PM #2
Why not just join the two tables in a simple query first, and base the form on that?
Then, once the doctor's name was selected (assuming these are unique or the id's are and that is what you select) then the Practice would show up automatically.
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 14,665 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
15-Apr-2009, 07:51 AM #3
mrwendal, I am a little confused by your question, your table design is correct up to a point, that point being the Doctor can only belong to one Practice, our Doctors belong to one practice but more than one "Practice Address". Your setup won't allow that.
Can you explain what the 3rd table is for. You should not Duplicate data. If the 3rd table is a Linking table with a Many to Many relationship to show what doctors belong to what surguries that is OK, but only the IDs sjould be stored in it.
__________________
OBP
I do not give up easily
mrwendal's Avatar
Member with 382 posts.
 
Join Date: Jul 2001
Location: England
15-Apr-2009, 08:35 AM #4
Quote:
Originally Posted by OBP View Post
mrwendal, I am a little confused by your question, your table design is correct up to a point, that point being the Doctor can only belong to one Practice, our Doctors belong to one practice but more than one "Practice Address". Your setup won't allow that.
Can you explain what the 3rd table is for. You should not Duplicate data. If the 3rd table is a Linking table with a Many to Many relationship to show what doctors belong to what surguries that is OK, but only the IDs sjould be stored in it.
Hi there,
Thanks for your replies.

I was trying to simplify the example, but sounds like it still isn't clear.

I need to record some basic assessment details (in other words, responses to some questions) which I have got working well by using form/subform. This information is entered into tables via a form (patient demographics and assessment results) all linked on patient id.
In the patient demographics table (my "third table") I wanted to record the GP plus the GP practice (for simplicity, assume in this example that a GP only belongs to one practice/address).

I can do the GP fine, but I was trying to get the form to return to screen the linked practice address as well as having this accepted in the underlying patients table.

Following my prior post, I have tinkered some more and I think I am now there!
I have made the GP field a lookup and used a query for the row source which includes the GP and Practice.
In the AfterUpdate event I have something like: GPPrac = cmbGP.Column(3) where GPPrac is the name of the GP Practice field and cmbGP is the GP field.

I have checked the form and selecting a GP now shows the relevant Practice and the form's underlying table contains the correct information too!

Thanks all for your time.
__________________
Before you criticize a man, walk a mile in his shoes.... That way, when you do criticize him - you'll be a mile away, and have his shoes
Reply

Tags
access, forms

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:38 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.