Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 10th, 2005, 06:39 PM
mboster mboster is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 2 mboster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 20 sec
Reputation Power: 0
Exclamation Print only checked fields on form

I currently have a table with 50-60 fields that are all checkboxes. I want to print only the field names that have been checked on a form. So if there are fields A, B, C, D, E, etc and only fields B, G and L are checked, I only want those field names printed on a form. How can I accomplish this?

Reply With Quote
  #2  
Old January 10th, 2005, 10:45 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Hi mboster,

Your question is simple in nature, but the answer is going to be fairly complex I am afraid. There are two ways to go about this:

1) Add all the controls (one for each checkbox) onto your report or form. Then either make the control visible or not visible depending on the value of the checkbox. The problem with this method is leaving a lot of blank or open spaces on your form or report where those controls that are invisible will be. The work around would be to use vba code to move the controls that are visible to where you want them on your form/report. But that can be a little tricky.

2) Create a recordset with only the controls that have been checked. Then you can use the CreateControls vba function to add only the controls for each of the fields from your sql. This would require a little bit of vba coding and you would have to delete all the prior controls from your form or report, if you are reusing the same form/report each time. Or you can use the create form/report function then delete the form/report after it has been printed. This might be an easier method given the number of fields from your table and with the number of possible combinations you might have. A sample code can be found in the access help files for creating a form and controls in design view using vba, and can be easily adapted to using the sql. If you need help in building the sql, creating the recordset from the sql or implementing the code, post back.

lwells

Reply With Quote
  #3  
Old January 11th, 2005, 01:47 PM
mboster mboster is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 2 mboster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 20 sec
Reputation Power: 0
lwells,

I have tried option 1, and the blank spots in the form (Report actually) are distracting to the users when printed. When all fields are visible, the printout is two pages, double columns for each record. All I really want is the information printed. It doesn't have to be displayed on the screen in a form, I just thought a form (Report) might be easier. Either way, I _will_ need assistance with the coding. If you want, I can send you the db for reference. Compacted and empty it's ~450kb.

mboster

Reply With Quote
  #4  
Old January 11th, 2005, 09:59 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Hi mboster,

Figured that you were talking about a report and yes the blank spaces would be annoying to the user. Go ahead and send your db to my email lwells1433@aol.com and I will be happy to get you started with the coding.

lwells

Reply With Quote
  #5  
Old June 2nd, 2006, 02:45 PM
eme126 eme126 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 6 eme126 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 33 m 26 sec
Reputation Power: 0
Exclamation

Hi, I'm having the same issue as mboster. I was wondering if you could help me please.

Reply With Quote
  #6  
Old June 2nd, 2006, 03:05 PM
Clarafication Clarafication is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 23 Clarafication User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 5 m 10 sec
Reputation Power: 0
To get rid of the blank spaces, make sure "Can Shrink" is Yes.

Reply With Quote
  #7  
Old June 2nd, 2006, 03:54 PM
eme126 eme126 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 6 eme126 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 33 m 26 sec
Reputation Power: 0
Question

What how do I add "all the controls" to each checkbox...I have to many....

Reply With Quote
  #8  
Old June 5th, 2006, 11:33 AM
eme126 eme126 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 6 eme126 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 33 m 26 sec
Reputation Power: 0
same problem

Quote:
Originally Posted by mboster
I currently have a table with 50-60 fields that are all checkboxes. I want to print only the field names that have been checked on a form. So if there are fields A, B, C, D, E, etc and only fields B, G and L are checked, I only want those field names printed on a form. How can I accomplish this?


Hello Mboster,

I am having the same problem you had. I was wondering if you could help me please. Thanks.

Reply With Quote
  #9  
Old June 5th, 2006, 05:02 PM
Clarafication Clarafication is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 23 Clarafication User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 5 m 10 sec
Reputation Power: 0
To put several controls on a form or report at one time, select them all from the field list and drag them in. To change the properties for all of them, select only the control part of each.

Reply With Quote
  #10  
Old June 6th, 2006, 10:42 AM
eme126 eme126 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 6 eme126 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 33 m 26 sec
Reputation Power: 0
Thanks Clarafication

Reply With Quote
  #11  
Old June 7th, 2006, 05:07 PM
Thunder Thunder is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 5 Thunder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m
Reputation Power: 0
Hello all
look at this example and tell if its good for u
Attached Files
File Type: zip db1.zip (14.4 KB, 207 views)

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Print only checked fields on form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT