A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#Error message in Switch statement



 
 
Thread Tools Display Modes
  #1  
Old December 8th, 2005, 09:29 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default #Error message in Switch statement

I have the following switch statement associated with the Control Source
property of a field in my report:
=Switch([RcvSpd]=0,"Low",[RcvSpd]=1,"High",[RcvSpd]=2,"Auto")

When I run the report, I get #Error displayed for that field.
If I replace the switch with simply "RcvSpd" (without the quotes) it reports
the numeric value in that field properly. The only values in the records are
1 and 2. There aren't any null values and there aren't even any fields set
to zero.

I've used this exact same switch on other reports and it works. I've
checked to ensure that the query this report is based on really has the
RcvSpd field in it.

Can anyone help? Thanks!

  #2  
Old December 8th, 2005, 09:35 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default #Error message in Switch statement

Check the name of the text box. It is probably "RcvSpd" which should be
changed.
You might also try:
=Choose([RcvSpd]+1,"Low","High","Auto")


--
Duane Hookom
MS Access MVP
--

"Wings" wrote in message
...
I have the following switch statement associated with the Control Source
property of a field in my report:
=Switch([RcvSpd]=0,"Low",[RcvSpd]=1,"High",[RcvSpd]=2,"Auto")

When I run the report, I get #Error displayed for that field.
If I replace the switch with simply "RcvSpd" (without the quotes) it
reports
the numeric value in that field properly. The only values in the records
are
1 and 2. There aren't any null values and there aren't even any fields
set
to zero.

I've used this exact same switch on other reports and it works. I've
checked to ensure that the query this report is based on really has the
RcvSpd field in it.

Can anyone help? Thanks!



  #3  
Old December 9th, 2005, 05:40 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default #Error message in Switch statement

Thank you Duane, that helped to some extent.
I tried the Choose statement and it worked. However then it stopped working
and displayed #Error. I looked at the text box name. I presume you are
refering to the "Name" property which is displayed in the property sheet for
the field I'm trying to get working. Yes it was called RcvSpd. but when I
changed it to RcvSpd1, it automatically changed the Choose statement to have
[RcvSpd1] instead of [RcvSpd]! And that's not right!

At one point I had both the Switch statement and the Choose statement
working and then managed to get both of them to fail and could not fix them.
Note: I keep cut and pasting in the strings (with Switch or Choose) in order
to ensure that it's not a typo.

I finally gave up, deleted the entire report and started over. I got the
choose statement to work but am now afraid to do anything else to the report
because I still don't understand WHY it sometimes just ceases to function.
Where would be a good place to read about how Switch and Choose and the
Control Source property work? I am very new to Access. I've tried the Help
files but the information is minimal - either that or I'm searching for the
wrong thing.

Thanks again!

"Duane Hookom" wrote:

Check the name of the text box. It is probably "RcvSpd" which should be
changed.
You might also try:
=Choose([RcvSpd]+1,"Low","High","Auto")


--
Duane Hookom
MS Access MVP
--

"Wings" wrote in message
...
I have the following switch statement associated with the Control Source
property of a field in my report:
=Switch([RcvSpd]=0,"Low",[RcvSpd]=1,"High",[RcvSpd]=2,"Auto")

When I run the report, I get #Error displayed for that field.
If I replace the switch with simply "RcvSpd" (without the quotes) it
reports
the numeric value in that field properly. The only values in the records
are
1 and 2. There aren't any null values and there aren't even any fields
set
to zero.

I've used this exact same switch on other reports and it works. I've
checked to ensure that the query this report is based on really has the
RcvSpd field in it.

Can anyone help? Thanks!




  #4  
Old December 9th, 2005, 07:16 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default #Error message in Switch statement

Do you have a field in your report's record source name RcvSpd1? Did you
check both the Name and Control Source properties?

Name: txtRcvSpd
Control Source: =Choose([RcvSpd]+1,"Low","High","Auto")


--
Duane Hookom
MS Access MVP


"Wings" wrote in message
...
Thank you Duane, that helped to some extent.
I tried the Choose statement and it worked. However then it stopped
working
and displayed #Error. I looked at the text box name. I presume you are
refering to the "Name" property which is displayed in the property sheet
for
the field I'm trying to get working. Yes it was called RcvSpd. but when
I
changed it to RcvSpd1, it automatically changed the Choose statement to
have
[RcvSpd1] instead of [RcvSpd]! And that's not right!

At one point I had both the Switch statement and the Choose statement
working and then managed to get both of them to fail and could not fix
them.
Note: I keep cut and pasting in the strings (with Switch or Choose) in
order
to ensure that it's not a typo.

I finally gave up, deleted the entire report and started over. I got the
choose statement to work but am now afraid to do anything else to the
report
because I still don't understand WHY it sometimes just ceases to function.
Where would be a good place to read about how Switch and Choose and the
Control Source property work? I am very new to Access. I've tried the Help
files but the information is minimal - either that or I'm searching for
the
wrong thing.

Thanks again!

"Duane Hookom" wrote:

Check the name of the text box. It is probably "RcvSpd" which should be
changed.
You might also try:
=Choose([RcvSpd]+1,"Low","High","Auto")


--
Duane Hookom
MS Access MVP
--

"Wings" wrote in message
...
I have the following switch statement associated with the Control Source
property of a field in my report:
=Switch([RcvSpd]=0,"Low",[RcvSpd]=1,"High",[RcvSpd]=2,"Auto")

When I run the report, I get #Error displayed for that field.
If I replace the switch with simply "RcvSpd" (without the quotes) it
reports
the numeric value in that field properly. The only values in the
records
are
1 and 2. There aren't any null values and there aren't even any fields
set
to zero.

I've used this exact same switch on other reports and it works. I've
checked to ensure that the query this report is based on really has the
RcvSpd field in it.

Can anyone help? Thanks!






 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
IIF statement or Switch() Belle Running & Setting Up Queries 13 January 12th, 2005 05:24 PM
EXCELL SQL statement that won't work for ACCESS jackle General Discussion 0 January 8th, 2005 07:13 PM
Calculated Mean Charles Deng Running & Setting Up Queries 21 October 15th, 2004 08:37 PM
Selector Switch with more than 4 positions needed Jeff Visio 0 August 24th, 2004 04:59 PM
multiple arrays in single statement Alan Beban Worksheet Functions 2 November 21st, 2003 12:34 PM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.