473,407 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

input form display problem.

Hello, I want to ask a question:

I got 2 tables:

Patients and Doctors,

Patients table has 3 fields: Patient_ID, Patient_Name, Doctor_ID

Doctors table has 2 fields:Doctor_ID, Doctor_Name

Doctor_ID is the foreign key.

I want to create a form to input new patient, in which the Doctor_Name
can be listed in a pull-down list to let the user select. Could anyone
tell me how can I do that?

Thanks!!

Mar 16 '08 #1
7 1312
Thanks a lot !

Hi Donald, I still want to ask, if I select the doctor name from the
combobox, will the corresponding doctor id be saved into patient's
table?

Mar 17 '08 #2
<ru*********@gmail.comwrote
Hi Donald, I still want to ask, if I select the doctor name from the
combobox, will the corresponding doctor id be saved into patient's
table?
Set the ComboBox up with a RowSource containing DoctorID and DoctorName, and
set DoctorID as the bound column, Doctor ID as the visible column, and
you'll do exactly what you want.

Larry Linson
Microsoft Office Access MVP

Mar 17 '08 #3
"Larry Linson" <bo*****@localhost.notwrote in
news:kLBDj.774$Nr1.492@trnddc01:
<ru*********@gmail.comwrote
>Hi Donald, I still want to ask, if I select the doctor name from
the combobox, will the corresponding doctor id be saved into
patient's table?

Set the ComboBox up with a RowSource containing DoctorID and
DoctorName, and set DoctorID as the bound column, Doctor ID as the
visible column, and you'll do exactly what you want.

Larry Linson
Microsoft Office Access MVP
I think you mean set Doctor Name as the visible column

:-)

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Mar 18 '08 #4
Bob Quintal wrote:
"Larry Linson" <bo*****@localhost.notwrote in
news:kLBDj.774$Nr1.492@trnddc01:
><ru*********@gmail.comwrote
>>Hi Donald, I still want to ask, if I select the doctor name from
the combobox, will the corresponding doctor id be saved into
patient's table?
Set the ComboBox up with a RowSource containing DoctorID and
DoctorName, and set DoctorID as the bound column, Doctor ID as the
visible column, and you'll do exactly what you want.

Larry Linson
Microsoft Office Access MVP
I think you mean set Doctor Name as the visible column

:-)
Mr. Linson is correct. I have several databases in use in my office
which I've created where I do just this sort of thing. The user can see
the Name portion of the lookup field in the record, and when selected,
it's actually the ID of that corresponding Name field that gets written
to the database. That makes sense because you can't expect the user to
know the ID of each Doctor.
Mar 18 '08 #5
My bad -- fingers faster than brain, sometimes. :-)

"Bob Quintal" <rq******@sPAmpatico.cawrote in message
news:Xn**********************@66.150.105.47...
"Larry Linson" <bo*****@localhost.notwrote in
news:kLBDj.774$Nr1.492@trnddc01:
><ru*********@gmail.comwrote
>>Hi Donald, I still want to ask, if I select the doctor name from
the combobox, will the corresponding doctor id be saved into
patient's table?

Set the ComboBox up with a RowSource containing DoctorID and
DoctorName, and set DoctorID as the bound column, Doctor ID as the
visible column, and you'll do exactly what you want.

Larry Linson
Microsoft Office Access MVP
I think you mean set Doctor Name as the visible column

:-)

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Mar 18 '08 #6
Thanks a lot! Now the form works as I expect ^_^

One more question , I cannot find visible column setting in the
properties of combobox. Is it because I am using Access2003, which
doesn't come with this property?

Mar 19 '08 #7
"ru*********@gmail.com" <ru*********@gmail.comwrote in news:41d05cdd-
54*************************@x30g2000...legrou ps.com:
Thanks a lot! Now the form works as I expect ^_^

One more question , I cannot find visible column setting in the
properties of combobox. Is it because I am using Access2003, which
doesn't come with this property?
In a combobox, you set the width of columns toi 0" to make them
invisible. so if your columns are DoctorID and Doctorname, making the
column widths 0";2" will hide the doctorID. Is that what you're asking?
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Mar 19 '08 #8

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

Similar topics

13
by: Stumped and Confused | last post by:
Hello, I really, really, need some help here - I've spent hours trying to find a solution. In a nutshell, I'm trying to have a user input a value in form's textfield. The value should then be...
2
by: Mike | last post by:
Hi I have been tasked with converting my pulp and paper mills weekly projected and actual contractor hrs excel spreadsheet into a an Access 97 database. So far my design has been to use a...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
1
by: John_H | last post by:
Re: ASP.NET 2.0 I would like suggestions or code examples on how to collect a variable length list of input data (item# & item quantity specifically). I thought that I could accomplish this...
2
by: magix | last post by:
Hi, I'm using Access Database with ASP. There is one particular thing that I have issue with. My purpose is for user to update their own profile. Their existing profile information will be...
3
by: Bob Sanderson | last post by:
I am trying to create a form for a MySQL database similar to a spreadsheet. The idea is to display a list of records, with the last line of the list being an input form. When the user enters data...
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
18
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin,...
2
by: Abneo | last post by:
Hi all, I am very new to Javascript and I am in some need of some help. I am creating a site that has a madlib. I got the madlib code but now I want the results of the madlib to display in...
5
leannsmarie
by: leannsmarie | last post by:
Hi Everyone, I have a problem with a program I have been assigned thats driving me crazy and I hope someone with a fresh eye could point me in the right direction. Im using Visual Basic Express...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.