Forms populating

G

Guest

I have a table for workorders that has a drop down for the username in a
seperate table called customers, when you select the user, how can i pull the
phone number in a seperate field based off the drop down based off the name.
 
B

Brian Bastl

assuming the phone number field exists in the Customers table, add the phone
number to the rowsource for the combobox, and then refer to it's column
index.

Brian

I have a table for workorders that has a drop down for the username in a
seperate table called customers, when you select the user, how can i pull the
phone number in a seperate field based off the drop down based off the
name.
 
G

Guest

Is this where you use the SELECT DISTINCT Customers.Country From Customers;

Or is there another format to use? Please assist me.....

Thanks!!!
 
B

Brian Bastl

Hi lmossolle,

if that is the row source for your combobox, then yes, you'll add the
telephone number field to that. You'd set the control source for your
unbound textbox to the name of your combobox along with its column index,
noting that the column index is "zero-based", meaning that column 1 =
..Column(0), col 2 = (1), etc...

For sake of example, your combobox name is cboCustomer.

cboCustomer -
RowSource:
SELECT CustomerID, Customer, Phone
FROM Customers
ORDER BY Customer;

Column Count =3 'total number of fields in query
Bound Column =1 'CustomerID
Column Widths = 0";2" 'displays only Customer name

Sooo, the control source for txtPhone would be: =[cboCustomer].[Column](2)

HTH,
Brian
 
G

Guest

I am new to Access this far, I appreciate any help. Can I make a Combobox
hidden and then add all the required fields so the users will not see?

Brian Bastl said:
Hi lmossolle,

if that is the row source for your combobox, then yes, you'll add the
telephone number field to that. You'd set the control source for your
unbound textbox to the name of your combobox along with its column index,
noting that the column index is "zero-based", meaning that column 1 =
..Column(0), col 2 = (1), etc...

For sake of example, your combobox name is cboCustomer.

cboCustomer -
RowSource:
SELECT CustomerID, Customer, Phone
FROM Customers
ORDER BY Customer;

Column Count =3 'total number of fields in query
Bound Column =1 'CustomerID
Column Widths = 0";2" 'displays only Customer name

Sooo, the control source for txtPhone would be: =[cboCustomer].[Column](2)

HTH,
Brian


Is this where you use the SELECT DISTINCT Customers.Country From Customers;

Or is there another format to use? Please assist me.....

Thanks!!!
 
B

Brian Bastl

You could make it so that the combobox is hidden when you're displaying an
existing record using the form's On Current event procedure, but you
certainly need it visible when on a new record. Something like the following
might be what you're trying to achieve:

Private Sub Form_Current()

Me.cboCustomer.Visible = Me.NewRecord

End Sub

Brian

I am new to Access this far, I appreciate any help. Can I make a Combobox
hidden and then add all the required fields so the users will not see?

Brian Bastl said:
Hi lmossolle,

if that is the row source for your combobox, then yes, you'll add the
telephone number field to that. You'd set the control source for your
unbound textbox to the name of your combobox along with its column index,
noting that the column index is "zero-based", meaning that column 1 =
..Column(0), col 2 = (1), etc...

For sake of example, your combobox name is cboCustomer.

cboCustomer -
RowSource:
SELECT CustomerID, Customer, Phone
FROM Customers
ORDER BY Customer;

Column Count =3 'total number of fields in query
Bound Column =1 'CustomerID
Column Widths = 0";2" 'displays only Customer name

Sooo, the control source for txtPhone would be: =[cboCustomer].[Column](2)

HTH,
Brian


message news:[email protected]...
Is this where you use the SELECT DISTINCT Customers.Country From Customers;

Or is there another format to use? Please assist me.....

Thanks!!!

:

assuming the phone number field exists in the Customers table, add
the
phone
number to the rowsource for the combobox, and then refer to it's column
index.

Brian

"(e-mail address removed)" <[email protected]>
wrote
in
message I have a table for workorders that has a drop down for the
username in
a
seperate table called customers, when you select the user, how can
i
pull
the
phone number in a seperate field based off the drop down based off the
name.
 
G

Guest

I finally got this done, thank you very much! Now how can I get it to write
in a table? It will not post some of the information, such as Section, Room
#, Make, Model and serial Number. If you could assist on this, I would
appreciate it. Thank you for all the assistance!!!

Brian Bastl said:
You could make it so that the combobox is hidden when you're displaying an
existing record using the form's On Current event procedure, but you
certainly need it visible when on a new record. Something like the following
might be what you're trying to achieve:

Private Sub Form_Current()

Me.cboCustomer.Visible = Me.NewRecord

End Sub

Brian

I am new to Access this far, I appreciate any help. Can I make a Combobox
hidden and then add all the required fields so the users will not see?

Brian Bastl said:
Hi lmossolle,

if that is the row source for your combobox, then yes, you'll add the
telephone number field to that. You'd set the control source for your
unbound textbox to the name of your combobox along with its column index,
noting that the column index is "zero-based", meaning that column 1 =
..Column(0), col 2 = (1), etc...

For sake of example, your combobox name is cboCustomer.

cboCustomer -
RowSource:
SELECT CustomerID, Customer, Phone
FROM Customers
ORDER BY Customer;

Column Count =3 'total number of fields in query
Bound Column =1 'CustomerID
Column Widths = 0";2" 'displays only Customer name

Sooo, the control source for txtPhone would be: =[cboCustomer].[Column](2)

HTH,
Brian


message Is this where you use the SELECT DISTINCT Customers.Country From
Customers;

Or is there another format to use? Please assist me.....

Thanks!!!

:

assuming the phone number field exists in the Customers table, add the
phone
number to the rowsource for the combobox, and then refer to it's column
index.

Brian

in
message I have a table for workorders that has a drop down for the username in
a
seperate table called customers, when you select the user, how can i
pull
the
phone number in a seperate field based off the drop down based off the
name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top