update textbox based on combobox

P

patelniravd

I would like to upate textbox based on combobox1. combox1 rowsource
displays 3 columns - customer name, id and address. when I select any
customer from there, I want to copy address from the selected row to a
text box in the same form. How can I do that?
 
D

Duane Hookom

If you want to display the address, set the control source of the text box
to:
=combobox1.Column(2)
You might want to do yourself a favor and rename the combo box to something
that makes sense like cboCustomerID.
 
D

DrZilboorg

Duane said:
If you want to display the address, set the control source of the text box
to:
=combobox1.Column(2)
You might want to do yourself a favor and rename the combo box to something
that makes sense like cboCustomerID.

I want to limit the display of genrebox from the results of catalogbox. Can I
use the same form for the criteria fields in the query for genre box in a
test loop?
eg:
=catalogbox.column1 Test (I don't know the code language yet, but that's
secondary to theory), True, then genrebox.column1; catalogbox.column2 test
true then genrebox.column 2 and so on?

Basically I want to return a selected column of values from genrebox after
selecting the catalog, kind of like nested if/then scenario's in excel.
 
D

DrZilboorg

Duane said:
You lost me. What do you have and what do you want to do?
[quoted text clipped - 19 lines]
Basically I want to return a selected column of values from genrebox after
selecting the catalog, kind of like nested if/then scenario's in excel.
Sorry for the delay.

I am building an inventory tracking program for books. Category is five
columns (nonfiction, fiction etc); genre that resides as a value list in the
properties of the combo box. Genre is a list of columns that resides in a
table (About 150 and growing). I want the form box for genre to react to the
value in the category box by providing the results of a query to the genre
table; and thus be able to enter the genre with a couple keystrokes using
autofill from the query.

In other words, if I have a book on Access, I want to categorize it as
nonfiction, enter "C" and "o" into the genre box and have the box go to the
first alphabetical record in the nonficion column that starts with co (could
be computer, could be country, could be cold war); a third or forth keystroke
will zero in on the selection.

I'm very new to access but I understand nested commands in excel and have
built some very elegant conditional forms in excel.

Because this problem will recur in many different forms within this data base,
the theory of the language is more important that the actual programming for
this particular set of commands (when a book sells, for example, I will need
to find the book with a similar query in my accounting form, so I can create
other records).

Thanks in advance.
DrZ (not my real name)
 
D

Duane Hookom

"Category is five columns"... columns generally equates to fields. I'm not
sure how Category can be five fields/columns. There could be a list of five
different values for Category. These would generally reside in a lookup
table.

Are you asking how to have one combo box be limited by a selection made in
another combo box? If so, Roger Carlson has a sample database that demos
this at http://www.rogersaccesslibrary.com/TableOfContents3.asp#C.

--
Duane Hookom
MS Access MVP
--

DrZilboorg said:
Duane said:
You lost me. What do you have and what do you want to do?
If you want to display the address, set the control source of the text
box
to:
[quoted text clipped - 19 lines]
Basically I want to return a selected column of values from genrebox
after
selecting the catalog, kind of like nested if/then scenario's in excel.
Sorry for the delay.

I am building an inventory tracking program for books. Category is five
columns (nonfiction, fiction etc); genre that resides as a value list in
the
properties of the combo box. Genre is a list of columns that resides in a
table (About 150 and growing). I want the form box for genre to react to
the
value in the category box by providing the results of a query to the genre
table; and thus be able to enter the genre with a couple keystrokes using
autofill from the query.

In other words, if I have a book on Access, I want to categorize it as
nonfiction, enter "C" and "o" into the genre box and have the box go to
the
first alphabetical record in the nonficion column that starts with co
(could
be computer, could be country, could be cold war); a third or forth
keystroke
will zero in on the selection.

I'm very new to access but I understand nested commands in excel and have
built some very elegant conditional forms in excel.

Because this problem will recur in many different forms within this data
base,
the theory of the language is more important that the actual programming
for
this particular set of commands (when a book sells, for example, I will
need
to find the book with a similar query in my accounting form, so I can
create
other records).

Thanks in advance.
DrZ (not my real name)
 
D

DrZilboorg via AccessMonster.com

Duane, thanks

A beautiful resource. Found the perfect template.

I think what I need to do is add a column (field) where the rows are equal to
the catalog names - I'm probably handicapped with years of thinking excel in
building my tables.

I'll see what happens, if I need to rebuild, I do.
 

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