PC Review


Reply
Thread Tools Rate Thread

choose function

 
 
iccsi
Guest
Posts: n/a
 
      19th May 2010
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,

 
Reply With Quote
 
 
 
 
Tom van Stiphout
Guest
Posts: n/a
 
      19th May 2010
On Wed, 19 May 2010 07:37:48 -0700 (PDT), iccsi <(E-Mail Removed)>
wrote:

Choose(Me.myDropdown.Column(4), "TextForIndex0", "TextForIndex1",
"TextForIndex2, ...etc)

-Tom.
Microsoft Access MVP


>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,

 
Reply With Quote
 
Daryl S
Guest
Posts: n/a
 
      19th May 2010
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,
>
> .
>

 
Reply With Quote
 
iccsi
Guest
Posts: n/a
 
      19th May 2010
On May 19, 11:27*am, Daryl S <Dar...@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, thenyou
> 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,
 
Reply With Quote
 
Tom van Stiphout
Guest
Posts: n/a
 
      20th May 2010
On Wed, 19 May 2010 11:39:42 -0700 (PDT), iccsi <(E-Mail Removed)>
wrote:

Rather than your attempt at a subselect you can use DLookup function.

I also have a feeling there should be a simpler solution with joins,
but it would require more information about your database structure to
determine that for sure.

-Tom.
Microsoft Access MVP



>On May 19, 11:27*am, Daryl S <Dar...@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,

 
Reply With Quote
 
Daryl S
Guest
Posts: n/a
 
      20th May 2010
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...@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,
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Choose function Khalil Handal Microsoft Excel Discussion 8 16th Aug 2009 01:31 PM
choose function Renee Microsoft Access Forms 0 17th Jun 2009 10:17 PM
Choose Function JimP Microsoft Access VBA Modules 4 26th Jul 2007 08:12 PM
How can 0 be used in the Choose function =?Utf-8?B?TWF4?= Microsoft Excel Worksheet Functions 3 16th Jun 2007 09:41 PM
Choose Function Steve Microsoft Access 14 16th May 2006 06:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:25 AM.