473,385 Members | 1,536 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,385 software developers and data experts.

Convert database values to check boxes in report

I have a database field called "report_type" that has three possible values (Initial / Follow-up / Final) selected via drop down box.

I need to convert that selected value into a checked box on a report.
Oct 29 '14 #1

✓ answered by NeoPa

We'll take one step at a time for now, but I don't think you'd need to do anything further there. That part seems perfect to me already. The only problem earlier was that you were feeding it a string value instead of a numeric one.

If you look at the Control Source of the OptionGroup control, then at the various Option Values of the associated CheckBoxes then imagine if the value of the OptionGroup control matches any one of the Option Values of the associated CheckBoxes then you'll see that the matching CheckBox will be shown with the X.

Obviously, if the new value (1-5) were added as a different field instead of just [Category] as it is currently, then you'd need to change the Control Source of the OptionGroup control to match the new field name.

20 1488
zmbd
5,501 Expert Mod 4TB
Basic would be:
Expand|Select|Wrap|Line Numbers
  1. IIF(testcondition,-1,IIF(testconditon2,0,null))
Assuming that the check box has the triple state set.

A little more detail is required.
Oct 29 '14 #2
twinnyfo
3,653 Expert Mod 2GB
You could also use an option group, which would display a check in a particular box, based on the value of the field. But, again, as Z says, we need more details.
Oct 29 '14 #3
zmbd
5,501 Expert Mod 4TB
Ok, back from the lab-timer
It would actually be easier from a form design if the value of the bound field was either 0, -1, empty/null for the checkbox and the check box triple-state set to true. (so you get: true(-1) = [x], False = [ ] and null = [O])

For the option group the requirement here is for the field to return of 1, 2, 3... to toggle the proper button

In either case, I'd build a query with a calculated field that returned the proper value and bind that field to the control.
Oct 29 '14 #4
OK - back to this old problem.

I now have an option group called Category created on my report which lists 5 separate choices (Check-boxes). I need one of the five check-boxes selected based on the field (Category) contained in my tblIncidents.

How do I link the tblIncidents.[Category] field to this option group on my report so that the correct Category is selected when the report is printed.
Apr 19 '17 #5
NeoPa
32,556 Expert Mod 16PB
If you have an optionGroup then you should know that, as long as each item in the group having a value TRUE or FALSE, and only one of them being TRUE, the OptionGroup also has a numeric value that reflects which item is selected.

So you can use the value of the OptionGroup to determine which category is selected.
Apr 19 '17 #6
I understand the concept but lack the practical experience to make it happen.

How do I make the option group in the report display the data contained in the database?
Apr 20 '17 #7
NeoPa
32,556 Expert Mod 16PB
Well, a million different ways. To help you display it the way you want it displayed i'd need to know how you want it displayed. You haven't included that information in your question yet.

If you include some example data then your lack of expressing the question properly can probably be less critical.
Apr 20 '17 #8
OK. I've attached a small subset of the database I am trying to sort out. The report "INCIDENT REPORT" is based on QUERY "qryISSIH"

When you launch the report, you will be asked to enter an Case Number.

Use 17-0056, 17-0058, or 17-0059.

Ignore the next request for a Report Type (Just hit OK)

The report will populate and then you will see the Option Group on Page 2 of the report

The options are based on the "Category" field in the qryISSIH.

Which box shows as selected should be evident based on the "category" field.

I am forced to used this particular report format as it is mandated by our headquarters.

Once completed, we print it to PDF and then email it to our central repository for further investigation (as needed) and/or filing.

Your assistance is greatly appreciated.
Attached Files
File Type: zip Database1.zip (1.13 MB, 45 views)
Apr 20 '17 #9
NeoPa
32,556 Expert Mod 16PB
So, if I interpret your directions correctly then I would assume you're looking for the data to be displayed in the report as a list of possible categories where the actual category has an X against it in a CheckBox. Is that right?

Bear in mind this is the explanation I was looking for. Very few people will download an attachment.
  1. It takes a lot more of their time in order to help you than is necessary if you ask the question properly.
  2. Access databases have the possibility for executable code which can be malicious.
I get the feeling you're doing your best and hadn't considered those aspects so I've cut you a break this time. Please remember though for future responses.

This is what I see at the top of page #2 and that's what I assume you're referring to.



For now, just assuming everything I've said above is actually what you're looking for, let me ask have you tried an OptionGroup in the report itself? It seems perfect for what I think you're asking for.
Attached Images
File Type: jpg 2017-04-21_01-41-59.jpg (44.5 KB, 150 views)
Apr 21 '17 #10
I appreciate the help and Yes, you have deduced my wishes correctly.

What you see in the report is my attempt at putting the option group in the report but I don't know how to link it to the "Category" filed in the query (qryISSIH) and have it display the correct category in the option group.
Apr 21 '17 #11
NeoPa
32,556 Expert Mod 16PB
Looking further into your database it seems you have the full text as the index into your [tblCategory] table. I won't go into all the reasons why that isn't the recommended way of doing things but if you can build an OptionGroup that expects the simbple values 1 - 5 and populate your query with data that converts from your category full name into that value, then things may work for you. I suspect the quickest and easiest way to see this work (Though this wouldn't be my recommended design, you understand.) would be to add an extra numeric field into [tblCategory] and return that linked value in your query. Maybe as an extra field to make it clearer to anyone working with it what it refers to.

PS. I posted this before seeing your latest post but it seems to be what you need anyway. Let us know if this does it for you or if you need further help on this specific issue (Other issues would require to be posted separately of course).
Apr 21 '17 #12
NeoPa
32,556 Expert Mod 16PB
Bear in mind, if we can get this working for you in the next couple of days then that's less than 2.5 years from start to finish. Possibly not our quickest ever success :-D
Apr 21 '17 #13
Obviously, I am not a DBA nor a developer of any kind. If I were to add the extra field into the tblCategory so that it showed the simple values 1 thru 5 and reworked the query so it showed those values, how would I make the option group show the correct checked box?
Apr 21 '17 #14
NeoPa
32,556 Expert Mod 16PB
We'll take one step at a time for now, but I don't think you'd need to do anything further there. That part seems perfect to me already. The only problem earlier was that you were feeding it a string value instead of a numeric one.

If you look at the Control Source of the OptionGroup control, then at the various Option Values of the associated CheckBoxes then imagine if the value of the OptionGroup control matches any one of the Option Values of the associated CheckBoxes then you'll see that the matching CheckBox will be shown with the X.

Obviously, if the new value (1-5) were added as a different field instead of just [Category] as it is currently, then you'd need to change the Control Source of the OptionGroup control to match the new field name.
Apr 21 '17 #15
I know you are trying to point me in the right direction to a realization but I am just not getting what I need to do here.

I know I need to make the category field seem like a numerical value of 1 to 5 so that the right box shows as selected but I am not getting how to take the string currently in the category field and make it that value.

Is it an IIF or CASE statement that has to be written?
Apr 21 '17 #16
NeoPa
32,556 Expert Mod 16PB
No. In your query add [tblCategory] and link from your [tblIncidents].[Category] text field to the PK ([tblCategory].[Category]) and then drop the newly created numeric field into the query.
Apr 21 '17 #17
NeoPa
32,556 Expert Mod 16PB
It should look something like :


BTW It works fine my end. A tick rather than an X it seems, but who's counting ;-)
Attached Images
File Type: jpg 2017-04-21_02-40-43.jpg (72.6 KB, 150 views)
Apr 21 '17 #18
And now I would change the Control Source of the Option Group to CATNo instead of Category?
Apr 21 '17 #19
You ROCK!!

Thank You!
Apr 21 '17 #20
NeoPa
32,556 Expert Mod 16PB
I'm guessing you know the answer to that by now, but yes. Exactly.

BTW I'll change the BestAnswer post to one that is more helpful to others reading the thread. Thank you for selecting it though. They all help for my re-nomination for Access MVP.
Apr 21 '17 #21

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jim in Arizona | last post by:
I'm having dificulty figuring out how to process multiple check boxes on a web form. Let's say I have three check boxes: cbox1 cbox2 cbox3 The only way I can think of to code the...
10
by: Jim in Arizona | last post by:
I'm having dificulty figuring out how to process multiple check boxes on a web form. Let's say I have three check boxes: cbox1 cbox2 cbox3 The only way I can think of to code the...
5
by: Shreekant Patel | last post by:
Hello, I am new to the advanced level of access, and I have quite a few changes to make to an existing database. The current database's main form needs to have additional check boxes added to...
2
by: cpptutor2000 | last post by:
Could some PHP guru please help me? I have very standard PHP - MySQL application that reads in some data from a table and for each row, puts a check box at the start of the row. Now the check boxes...
4
by: cdub100 | last post by:
Access 2003 Windows XP I have a form containing contact information along with 6 check boxes. I want to be able to run a report with just the entries with certain boxes checked. Example: I...
1
by: eclipse93081 | last post by:
I need a way to sum check boxes in Access. On the database interface I have 3 boxes you can check; "Scheduled/Went On", "Scheduled/Did Not Go On", and "Not Scheduled". I have the boxes set up as...
4
by: ckpoll2 | last post by:
Ok, so I'm wondering if what I need to do is even possible because I haven't been able to figure out how to do it and I haven't seen any similar posts on here. In a table, I have a series of...
1
by: ghjk | last post by:
my php page has 7 check boxes. I stored checked values to database and retrive as binary values. This is the result array Array ( => 0 => 1 => 0 => 1 => 0 => 0 => 1 ) 1 means checked....
20
dgaletar
by: dgaletar | last post by:
Hello all, We are mechanics in a small fleet shop. We perform basic maintenance on the Universities vehicles on a quarterly basis. I am attempting to update an outdated manual system with an...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.