patjones 931
Recognized Expert Contributor
Hi:
I have a table in my Access database, "tblWC", which contains a field called "fldTrackingSta tus". Furthermore, I have a report "rptTrackingRep ort" which is based on tblWC (using an SQL query written out in VB). The report sorts all the records out by fldTrackingStat us, which can have an integer value between 1 and 5 inclusive.
The problem is, the report is putting "1", "2", "3", etc. at the top of each tracking status sub-section. I would like to replace those with descriptive text. For instance, instead of "1" the heading for the section containing all records with tracking status 1 would be "Employees out using WC balances".
I have accomplished this by inserting a text box into the tracking status header in report design view, then setting the control source of the text box equal to a bunch of nested "iif" statements:
=IIf([txtTrackingStat us]=1,"Out using WC balances",IIf([txtTrackingStat us]=2,"Receiving grant",IIf([txtTrackingStat us]=3,"Currently on C-status",IIf([txtTrackingStat us]=4,"Recently returned from using WC balances","Rece ntly returned from C-status"))))
My question is whether or not there's a better way for me to accomplish this in the report's VB module, using say a "case" structure. I just want to try and keep things contained in VB as much as possible.
Thank you in advance for any insight you guys can yield.
Pat
5 1593 JKing 1,206
Recognized Expert Top Contributor
You have posted your question in the Articles section rather than the Forum section.
I have moved it across for you.
MODERATOR.
JKing 1,206
Recognized Expert Top Contributor
Why not create a table that stores the values for each of the 5 integers? Then you could include this table in the query and the field storing the status description, This would allow you to simply drag the field onto the report without any code required.
Jared
patjones 931
Recognized Expert Contributor
Why not create a table that stores the values for each of the 5 integers? Then you could include this table in the query and the field storing the status description, This would allow you to simply drag the field onto the report without any code required.
Jared
I feel like I should've thought of that!
You're suggesting to have a new table with fldTrackingStat us integers as the primary key column and the verbal descriptions in the other column...then establishing a relationship to tblWC via the integers?
I'm going to try it immediately. And thank you for moving my post over. I wasn't paying attention obviously...
Pat
JKing 1,206
Recognized Expert Top Contributor
I feel like I should've thought of that!
You're suggesting to have a new table with fldTrackingStat us integers as the primary key column and the verbal descriptions in the other column...then establishing a relationship to tblWC via the integers?
I'm going to try it immediately. And thank you for moving my post over. I wasn't paying attention obviously...
Pat
That's exactly what I'm suggesting. It should work out nicely for you.
Jared
patjones 931
Recognized Expert Contributor
That's exactly what I'm suggesting. It should work out nicely for you.
Jared
Works great. Thanks!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Rick Caborn |
last post by:
Does anyone know of a way to execute sql code from a dynamically built
text field?
Before beginning, let me state that I know this db architecture is
built solely for frustration and I hope to make it better soon.
Unfortunately, there is never a non-crucial time in which we can do an
upgrade, so we are stuck for now.
Point 1:
There are multiple tables: students, courses, cross-reference
|
by: Tony |
last post by:
Thanks for writing back and don't laugh at what I am
about to post I am new to this type of stuff....this is
what I have tried and it isn't working(please note in the
try section I was just trying to see if it was grabbing
my variable or not any suggestions or hints would be
greatly appreciated:
********
Private Sub AddArticle()
|
by: Warren |
last post by:
I am trying to create a report that does the following:
Access Data in Query:
NAME | DATE | SALE TYPE |
-------------------------
John DOE | 1282003 | TYPE A
Jane DOE | 1282003 | TYPE C
Jane DOE | 1282003 | TYPE D
Jane DOE | 1282003 | TYPE C
|
by: Richard Hollenbeck |
last post by:
I noticed I can't push a value into a text box by saying something like,
"txtThisTextBox = intSomeVariable * 0.5"
because I get an run-time error saying I can't assign a value to this
object.
So instead I made the control source a function to pull the value from the
function. That works. Inside the text box I simply write something like
=SomeFunction(). Beautiful. Works great.
|
by: nimmi_srivastav |
last post by:
Below you will see an example of a nested conditional expression that
this colleague of mine loves. He claims that it is more efficient that
a multi-level if-else-if structure. Moreover, our complexity analyzer
tool supposedly does not pick it up. Is it really more efficient?
Personally I find this coding style extremely cryptic, misleading and
error-prone.
I believe that I have removed all traces of proprietary-ness from this
coding...
| |
by: mitch |
last post by:
Suppose I have a DOM element, say a td, and I want to add a
value to it to be used later. I am unclear on when it's OK to do
td.myAttr = "hello";
versus when I need to do
td.setAttribute("myAttr", "hello");
Could somebody explain the difference between these two?
|
by: mj.redfox.mj |
last post by:
Can anyone help? I have a textbox which I'm programatically adding by
using the following code:
txtTest = New TextBox
txtTest.ID = "txtLeft" + cntCount.ToString
Page.FindControl("tdInput").Controls.Add(txtTest)
This successfully creates a textbox called "txtLeft1" in the table
|
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ |
last post by:
I have created a report. This report needs to display records
between two dates entered by the user. I put two text boxes on the
report so I can enter the start and end date - I set them to use an
input mask of 'short date' format. The problem is that when I enter
anything in these text boxes, as soon as the field looses focus, the
text is cleared out - thus the text box is left blank. I have a button
on the form that calls the requery...
|
by: miken32 |
last post by:
In PHP, if a function returns an array it's fairly common to capture
its return values like this:
<?php
list($foo, $bar, $baz) = some_function_that_return_an_array();
?>
In Javascript, would the equivalent (acceptable) code be this?
= some_function_that_return_an_array();
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |