From: Daryl S on
Iccsi -

What you posted is not a SQL statement (maybe you only posted part of it?).
The Choose function expects a list of values or expressions separated by
commas following the initial expression, but you don't have that. Something
like this would work:

Choose([Forms]![MyForm]![MyDropDown]![Column](3),"ResponseForChoice1","ResponseForchoice2","ResponseForchoice3")
But for that to work, your combo box would only have values 1, 2, or 3.

Maybe you need to explain what is in the combo box and what you want
returned based on what the user selects. For example, if you really want the
MyID from the table based on the user selecting "GP1", or "GP2", etc. from
the combo list, then what you would want is something like this:

DLookup("[MyID]","[tblMyTable]","True = [tblMyTable].[" &
[Forms]![MyForm]![MyDropDown]![Column](3) & "]")

If this isn't what you want, then let us know what your goal is...


--
Daryl S


"iccsi" wrote:

> On May 19, 11:27 am, Daryl S <Dar...(a)discussions.microsoft.com> wrote:
> > icssi -
> >
> > If the fourth column of your drop-down contains only integers, and your
> > choose function will have all the choices for the possible integers, then you
> > can do this. Remember that columns in combo-boxes are zero-based, so
> > .Column(0) is the first column, and .Column(3) is the fourth column of the
> > selected record (assuming multi-selections is not allowed).
> >
> > If you have problems, post your code so we can help.
> >
> > --
> > Daryl S
> >
> >
> >
> > "iccsi" wrote:
> > > I would like to use choose function from dropdown box column 4.
> > > for example:
> >
> > > Choose([myform[![mydropdown]![column](4), myvalue = "something",
> > > myvalue = "that thing")
> > > Can I do above using choose function?
> > > If I can, can you please advise the proper syntax?
> > > If not, any other solution for this?
> >
> > > Your help is great appreciated,
> >
> > > .- Hide quoted text -
> >
> > - Show quoted text -
>
> I use choose function in a query. The syntax failed when I tried to
> run the query like following:
>
> Choose([Forms]![MyForm]![MyDropDown]![Column](3),
> [tblMyTable].[MyID] In (Select MyID from tblMyTable where GP1 = True),
> [tblMyTable].[MyID] In (Select MyID from tblMyTable where GP2 = True))
>
>
> thanks again,
> .
>