473,406 Members | 2,356 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,406 software developers and data experts.

How to get desired field data with the help of check boxes?

I have a table stored in Access. I want a query form that will contain check boxes for each column in the table.

The tabular report that will be generated must contain those columns which are selected in the form.

can some one please let me know how?
Dec 19 '07 #1
3 1215
NeoPa
32,556 Expert Mod 16PB
I'm not sure you appreciate the enormity of the task you ask about. This would involve creating code to handle a redesign of a report. A report is an object designed to show certain data within a specific width.
Even if you were able to hide the unwanted fields, what would the report look like with great gaping spaces?
This is possible however, please indicate if you have the stomach for progressing with this. I don't want to be dealing with basic questions if we go further. This is not beginner level stuff so don't even go there unless you're confident you can handle it.
Dec 19 '07 #2
Thanks for the quick reply.

Dont worry for the basics I will be able to do it.

The problem is that I want the report in a table format with normal look. Not showing empty spaces for the hidden fields.
Dec 20 '07 #3
NeoPa
32,556 Expert Mod 16PB
Right, I'm not entirely convinced you have the basics covered (your 2 or 3 line response didn't inspire confidence), but I will give the gist of how I would approach the problem and see where we go from there.
Any reasonable questions (not ones I consider too basic) will find me willing to post replies to. Remember I warned you before we started how this was going to work.
  1. Start by determining a method of passing the information from the CheckBoxes to the report.
    I have a function I use for this which you're welcome to use :
    Expand|Select|Wrap|Line Numbers
    1. 'RptParms sets and returns a set of parameters required by a report.
    2. Public Function RptParms(intSetGet As Integer, _
    3.                          ParamArray avarParams() As Variant) As Variant
    4.     Static avarParms() As Variant
    5.     Dim intIdx As Integer
    6.  
    7.     RptParms = 0
    8.     If intSetGet = 0 Then
    9.         intSetGet = UBound(avarParams) + 1 - LBound(avarParams)
    10.         If intSetGet < 1 Then
    11.             ReDim avarParms(1 To 1)
    12.             avarParms(1) = "Error"
    13.             Exit Function
    14.         End If
    15.         ReDim avarParms(1 To intSetGet)
    16.         For intIdx = 1 To intSetGet
    17.             avarParms(intIdx) = avarParams(intIdx - 1)
    18.         Next intIdx
    19.     Else
    20.         'If outside bounds then it drops through and is set to "Error"
    21.         On Error Resume Next
    22.         If avarParms(intSetGet) = "Error" Then
    23.             RptParms = "Error"                  'On Error
    24.         Else
    25.             RptParms = avarParms(intSetGet)
    26.         End If
    27.     End If
    28. End Function
    Call the function before opening the report using intSetGet = 0 (and passing the string of required fields in avarParms) to pass the information on to the report.
    From within the report, call the function again (RptParms(1)) to pick up the string of fields that are required.
  2. Design a report with ALL the possible columns in it. We intend to hide columns that we don't need rather than create any new columns on the fly.
  3. In the reports Open event procedure, add code which handles all of the following :
    1. Processes the string of fields required.
    2. Processes through all the fields and sets only those which are required to visible. All others should be hidden.
    3. Processes through all the visible (displayed) fields setting their start positions (start pos + width of the previous field) and optionally, their widths. It may be that too many fields mean that some of the columns have to squeeze up.
    4. Sets the width of the report itself to match the width of the fields displayed (Try to - I'm not positive this can even work). This may not be necessary or what you want, but it's a consideration. I'll leave that up to you to decide on.

If I've missed anything out or you can't understand how I've explained something, that's fine to ask for clarification on.

Good luck.
Dec 20 '07 #4

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

Similar topics

4
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by...
11
by: Pete | last post by:
Is there any way to change the default search to "Any Part Of Field" instead of whole field? The first thing I ever do when searching for something in a field is change the default setting from...
9
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and...
2
by: Incolor | last post by:
Hello All! I have to generate a checklist form as an input form in Access. A paper form is taken out in the field and checked yes, no, OR n/a for each item inspected. The problem I am having is...
9
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo...
8
by: AA Arens | last post by:
Hi I do have a products table and products-parts table in my Access 2003 database and log all services into a form. I do have at least the following two combo boxes on my form: - Choose...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
2
by: David - Australia | last post by:
G'day from Australia, I'm hoping some bright spark may be able to help me with this one. I'm sure that it can be done, I've just hit a wall with it. So I'm opening it up. I'm storing student...
1
by: theJonster | last post by:
Hi, I have created a page with a list of items and next to these items are comment boxes and check boxes which were dynamically created like this: check = new CheckBox();...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
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...
0
isladogs
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...

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.