By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,501 Members | 2,871 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,501 IT Pros & Developers. It's quick & easy.

input form display problem.

P: n/a
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
Share this Question
Share on Google+
7 Replies


P: n/a
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

P: n/a
<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

P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.