IF
combo box query contains field1, field2 thru 5 in that seqence
if forinstance only bound field shows and it is field 2 then the
bound = 2
number fields = 5
field lengths = 0;1;0;0;0
the above is what you are looking for in general.
Now
in the afterupdate event of the combo box you can retrieve the fields
from that combo entry as follows
me.txttoshow1 = me.comboboxname.column(0)
me.txttoshow2 = me.comboboxname.column(1)
me.txttoshow3 = me.comboboxname.column(2)
me.txttoshow4 = me.comboboxname.column(3)
me.txttoshow5 = me.comboboxname.column(4)
The columns are relative to 0 (not 1)
Paperback Writer wrote:
> When you set up a Combo Box, it asks if you want it to bring up values from a
> query or a table. I selected "query." I then asked it to only return one
> field, which is the pivotal field.
>
> The related fields are in the same query. I want those text boxes, all of
> which are inside a form, to populate depending on what is selected in the
> combo box.
>
>
> "xRoachx" wrote:
>
> > Hi PW -- Can you clarify a little? Do you mean the query is used to populate
> > the combo box? Also, what do you mean by the query zeroes in on one field?
> > Last, the five fields you want automatically populated, are these in a form
> > or in the query?
> >
> > "Paperback Writer" wrote:
> >
> > > I have a combo box that sits on a query. This query zeroes in on one field.
> > > I'd like about five other fields from this query to be populated based on
> > > which value is selected in the combo box.
> > >
> > > How do I do this?
|