Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 22nd, 2006, 12:02 PM
Authorized User
 
Join Date: Jan 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default grouping yes/no fields

I'm in the process of setting up a form, and I have 4 yes/no fields that need to be in it. I want to group the fields so that only one of the yes/no fields will be able to be selected. The fields are: Pass, Fail, N/A, and obsolete.

I tried setting up an option group, but I can't seem to get the information to filter back to the table that is capturing the data.

Any help?

 
Old August 22nd, 2006, 12:53 PM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 142
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You might be better off using a ListBox.

 
Old August 23rd, 2006, 10:44 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

If you want to use the option group, you need all the boxes to refer back to one field in the table. The option group will return numbers, and each number represents the option:

Pass = 1
Fail = 2
N/A = 3
Obsolete = 4

   In subsequent reports, you can use Select Case to substitute the values:

Select Case Status
 Case 1
   sVariableName = "Pass"
 Case 2
   sVariableName = "Fail"
...
End Select

Me.Text1 = sVariableName

   Anywho, is that not what you want? Do you want the option group to pass text? I think it can do this. If not, just create an after update event for the status field (so I am calling it) to push a text value into a txtStatus field in the table.

Does this help?



mmcdonal
 
Old August 23rd, 2006, 12:43 PM
Authorized User
 
Join Date: Jan 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It helps quite a bit. Thanks! I'm new to option groups and managed to get one set up yesterday afternoon, but I do need the text for the values, to pull reports.

Thanks!

 
Old August 24th, 2006, 10:24 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Yes, MMcDonal is correct. Instead of four yes/no fields, you simply need one field of type number (byte) that will hold 1 through 4. The option group will work with that field.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old August 24th, 2006, 11:10 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

When you pull a report, you can sort by the option numbers, and replace the number values with text values at runtime.



mmcdonal
 
Old August 24th, 2006, 11:15 AM
Authorized User
 
Join Date: Jan 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks again for the help! This is not my database, I'm just working on a portion of it.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Protect cells and allow grouping/un-grouping sfreuden Excel VBA 4 December 14th, 2006 08:01 AM
XSLT 1.0 Grouping kwilliams XSLT 0 January 11th, 2006 06:30 PM
grouping / totaling happyslug BOOK: Professional Crystal Reports for VS.NET 1 July 12th, 2005 05:07 AM
Grouping and totals btado XSLT 3 June 22nd, 2005 01:08 AM
Using Forum fields select fields on the fly hellosureshkumar Crystal Reports 0 December 17th, 2004 08:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.