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  

Field changes per senario



 
 
Thread Tools Display Modes
  #1  
Old September 11th, 2009, 08:38 PM posted to microsoft.public.access.reports
ReggieRegister
external usenet poster
 
Posts: 1
Default Field changes per senario

I have a text field on a report that either gets its data from the result of
8 different scenarios
4 pertain to country, all pertain to a true or false result via check box,
and all pertain to value of a third control
I have tried writing 8 different If/Endif statements – this did not work
EG: IF ([country]=US And [check88]=true and [total]30) Then…

I tried stepped statements
EG:
If [country] Like "canada" Then
If [total] 40 Then
If [check88] = False Then
[myField] = "40"
Else
[myField] = [total]
End If
End If
Else
If [total] 30 And [Check88] = False Then
[myField] = "30"
Else
[myField] = [total]
End If
End If

None of these worked – any suggestions?

  #2  
Old September 11th, 2009, 09:03 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Field changes per senario

I would probably start by creating a lookup table to store the country and
myField values. You could then add this table to your report's record source
and join the country fields. Use the values of the myField and the checkbox
to calculate the value to display in myfield.

--
Duane Hookom
Microsoft Access MVP


"ReggieRegister" wrote:

I have a text field on a report that either gets its data from the result of
8 different scenarios
4 pertain to country, all pertain to a true or false result via check box,
and all pertain to value of a third control
I have tried writing 8 different If/Endif statements – this did not work
EG: IF ([country]=US And [check88]=true and [total]30) Then…

I tried stepped statements
EG:
If [country] Like "canada" Then
If [total] 40 Then
If [check88] = False Then
[myField] = "40"
Else
[myField] = [total]
End If
End If
Else
If [total] 30 And [Check88] = False Then
[myField] = "30"
Else
[myField] = [total]
End If
End If

None of these worked – any suggestions?

 




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


All times are GMT +1. The time now is 06:15 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.