Auto Generate text field

G

Guest

I have a from that users can inout ingredients for recipes. I want the user
to pick an ingredient from a drop down(which is already working). I also have
a field that has an item number. I want the item number to auto generate base
on the ingredient selected from the drop down.
 
G

Guest

You have an item number field already and you want to generate another one?
Also, if a new item number is generated every time a user selects an
ingredient it's going to make that item number field useless.

Or is your question how to populate a textbox with the already assigned item
number for the ingredient selected?
 
G

Guest

I have all my ingredients in a table with 3 fields auto number, ingredients
and item number.
On the form I want the user to select an ingredient and the item number auto
populates itself. for example. in the table auto number 2 is bacon with an
item number 9999.
on the form if the user selects bacon in the text field for item number 9999
will auto insert itself
 
G

Guest

OK, that makes more sense.

All you need to do is when you pick what data to show in your combobox,
include both the ingredient number and the ingredient name. You can hide the
number by shrinking it's field width to 0.

Then make the control source of your text box
=<YOUR_COMBO_BOX_NAME>.column(#) where # is the column number of your item
number from the combo box. If you put it in first it will be column(0) if
you put it in second it will be column(1).
 

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