Auto populate controls on a form

  • Thread starter Thread starter RAM
  • Start date Start date
R

RAM

I have a form that contains demographic data for patients and their primary
care physician. I would like to auto populate the primary care physicians
street address, city, state and zip controls based on his name. I have a
table with the primary care physcian data with a colum for each field listed.

Thanks in advance for any help.
 
The easiest was I know is to create a combobox with the PhysicianID,
FirstName, LastName, StreetAddress, city, state, and zip. You only need to
show his name, the rest of the columns can have a 0" width.

Now set the controlsource of unbound textboxes refering to the combo column
(0 based) so in the above example city would be:

= cboPhysician.Column(4)
 
Alvin I set the control source as you suggested and it worked for address1
control
=[LblPriPhy].[Column](2). But the following controls
=[LblPriPhy].[Column](3) which is address 2 and =[LblPriPhy].[Column](4)
which is City and =[LblPriPhy].[Column](5) which is state and
=[LblPriPhy].[Column](6) which is zip do not fill. Can you tell me what I'm
doing wrong.

Thanks
 
What is the column count of your combo box? If you haven't set it at 7, it
won't produce viewable data.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


RAM said:
Alvin I set the control source as you suggested and it worked for address1
control
=[LblPriPhy].[Column](2). But the following controls
=[LblPriPhy].[Column](3) which is address 2 and =[LblPriPhy].[Column](4)
which is City and =[LblPriPhy].[Column](5) which is state and
=[LblPriPhy].[Column](6) which is zip do not fill. Can you tell me what
I'm
doing wrong.

Thanks


Arvin Meyer said:
The easiest was I know is to create a combobox with the PhysicianID,
FirstName, LastName, StreetAddress, city, state, and zip. You only need
to
show his name, the rest of the columns can have a 0" width.

Now set the controlsource of unbound textboxes refering to the combo
column
(0 based) so in the above example city would be:

= cboPhysician.Column(4)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
Arvin thank you for the answer the column count was the problem.

Arvin Meyer said:
What is the column count of your combo box? If you haven't set it at 7, it
won't produce viewable data.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


RAM said:
Alvin I set the control source as you suggested and it worked for address1
control
=[LblPriPhy].[Column](2). But the following controls
=[LblPriPhy].[Column](3) which is address 2 and =[LblPriPhy].[Column](4)
which is City and =[LblPriPhy].[Column](5) which is state and
=[LblPriPhy].[Column](6) which is zip do not fill. Can you tell me what
I'm
doing wrong.

Thanks


Arvin Meyer said:
The easiest was I know is to create a combobox with the PhysicianID,
FirstName, LastName, StreetAddress, city, state, and zip. You only need
to
show his name, the rest of the columns can have a 0" width.

Now set the controlsource of unbound textboxes refering to the combo
column
(0 based) so in the above example city would be:

= cboPhysician.Column(4)
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


I have a form that contains demographic data for patients and their
primary
care physician. I would like to auto populate the primary care
physicians
street address, city, state and zip controls based on his name. I have
a
table with the primary care physcian data with a colum for each field
listed.

Thanks in advance for any help.
 
Back
Top