473,322 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Switch function max number of varexpressions in Access xp

jr
I have a niggle with the Switch function

I have a querey which has a column with 3 digit values of which there are
about 20 which are unique.

These are meaningless to the user and so using the switch function I assign
a string to each value.

theus
alias
Field4: Switch([fieldx2]=210,[field3]="government
Stock",[fieldx2]=209,[field3]=""equity",etc etc

However it seems I can only have up to about 15 conditions and I need abot
22

Does anyone know if there are settings to increase this

Or an alternative without me haveing to creater the values in a table and
linking it with my query - Although if else fails that is what I will do.

john rutherford

Nov 13 '05 #1
2 6204
On Sun, 12 Jun 2005 11:23:03 GMT, "jr" <jr************@virgin.net> wrote:
I have a niggle with the Switch function

I have a querey which has a column with 3 digit values of which there are
about 20 which are unique.

These are meaningless to the user and so using the switch function I assign
a string to each value.

theus
alias
Field4: Switch([fieldx2]=210,[field3]="government
Stock",[fieldx2]=209,[field3]=""equity",etc etc

However it seems I can only have up to about 15 conditions and I need abot
22

Does anyone know if there are settings to increase this

Or an alternative without me haveing to creater the values in a table and
linking it with my query - Although if else fails that is what I will do.

john rutherford


If you are using a Switch statement to convert numbers to names, the question
I have to ask is - why don't you just have a table of items with numeric IDs
and text names, and join to the table the get the names?

I notice you thought of that, so why are you avoiding going that route? That
would usually be the obvious way to do things in a database application, not
the fallback poisition you would try to avoid.
Nov 13 '05 #2
jr
Good question
I suppose its down to habit complexity and performance.
Introducing another table is fine but it adds to the process.
This particular query is 2nd level from sourced ODBC connected table data
which will then be grouped at a third level query - There are also four
other sets of data with 1st 2nd and 3rd grouped query data - And at summary
4th levelquery the various key business information value fields are
selected.

But at the end of the day you are right - I was only wondering if the SWITCH
settings could be adjusted either by access user - or the infamous Corporate
XP security admin and packagers The bain of all developers lives.


"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:jo********************************@4ax.com...
On Sun, 12 Jun 2005 11:23:03 GMT, "jr" <jr************@virgin.net> wrote:
I have a niggle with the Switch function

I have a querey which has a column with 3 digit values of which there areabout 20 which are unique.

These are meaningless to the user and so using the switch function I assigna string to each value.

theus
alias
Field4: Switch([fieldx2]=210,[field3]="government
Stock",[fieldx2]=209,[field3]=""equity",etc etc

However it seems I can only have up to about 15 conditions and I need abot22

Does anyone know if there are settings to increase this

Or an alternative without me haveing to creater the values in a table andlinking it with my query - Although if else fails that is what I will do.

john rutherford
If you are using a Switch statement to convert numbers to names, the

question I have to ask is - why don't you just have a table of items with numeric IDs and text names, and join to the table the get the names?

I notice you thought of that, so why are you avoiding going that route? That would usually be the obvious way to do things in a database application, not the fallback poisition you would try to avoid.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Rudi Hansen | last post by:
I dont seem to be able to find the switch statement in Python. I would like to be able to do switch(var) case 1 : print "var = 1" case 2: print "var = 2"
15
by: Mike and Jo | last post by:
I've been converting some code to C++. I'm trying to use the Switch function to compare a result. Is it possible to use switch to evaluate '>0', '<0', 0? Example switch (result) { case...
35
by: Thomas Matthews | last post by:
Hi, My son is writing a program to move a character. He is using the numbers on the keypad to indicate the direction of movement: 7 8 9 4 5 6 1 2 3 Each number has a direction except...
11
by: hasadh | last post by:
Hi, is the assemly code for if..else and switch statements similar. I would like to know if switch also uses value comparison for each case internally or does it jump to the case directly at...
13
by: webzila | last post by:
Hello, I have to write a program for an 8051 micro-controller using micro-C to monitor Switch 1 and if the switch in pushed the message "switch 1 pushed" should be displayed in the LCD. Also the...
7
by: cytec123187 | last post by:
Hello, I am working on an Adobe Acrobat file that uses javascript for calculations. I am trying to create a field that uses two other fields to determine a number value. I think this requires...
21
by: aaron80v | last post by:
Hi, A simple question: In ANSI-C, how to specify a string as the expression for switch statement. eg switch (mystr) { case "ABC" : bleh... break;
4
by: huzzaa | last post by:
I am using a switch statement that will decide from a random number what message to display. I want the random number to be between 0 and 100 and then if the number is say between 1 and 10 to...
9
by: Gordon | last post by:
I want to add a feature to a project I'm working on where i have multiple users set up on my Postgres database with varying levels of access. At the bare minimum there will be a login user who...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.