473,406 Members | 2,816 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.

making option group control visible based on rows in table

tuxalot
200 100+
Hello all,

I have a 2 column table that looks like such

1 apple
2 banana
3 orange
4 tomato
5 strawberry

This table could have up to 15 rows but may have as few as 3.

On my main form I have an option group with 15 toggles and values of 1-15. I would like to make the togglebuttons.visible = false for rows 6-15 in the above example. I guess I could run 15 dlookups but I was wondering if there was a better solution.

Playing with this but I'm (still) learning Access so it don't work:

table: tblSections
option group: grpSections

Dim intX As Integer
Dim ctl As Control

intX = DCount("*", "tblSections")
MsgBox (intX)

For Each ctl In Me.Controls("grpSections")
If TypeOf ctl Is ToggleButton And ctl.Value > intX Then
ctl.Visible = False
End If
Next ctl


I would very much appreciate any help you can provide.

WORKING NOW:


Dim intcount As Integer
Dim ctl As Control
intcount = DCount("*", "tblSections")
For Each ctl In Me.Controls
If TypeOf ctl Is ToggleButton Then
If ctl.Tag > intcount Then
ctl.Visible = False
Else
ctl.Visible = True
End If
End If
Next ctl
Nov 11 '10 #1
0 1210

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

Similar topics

2
by: Charles | last post by:
Ok, so I'm creating a form on the fly. I can create the option group, I can create the checkboxes, but I can't figure out how to bind them to the option group I'm creating them within. I was...
1
by: AA Arens | last post by:
I created an Option Group (go to Design View > Toolbox) and want the values to be filled in a present table. How to make it possible that not only nummeric values can be given, but also names? ...
2
by: Charlie | last post by:
Hi: When I drag a my custom server control from the toolbox to design surface it appears invisible except for little green arrow. I can change the width and fill color of control in prop sheet...
1
by: SP | last post by:
Hello there, I have a DataList create as below. <asp:DataList ID="dl_Immunpsuppressive_Main" Runat="server" Width="100%"> <ItemTemplate> <table id="Immunpsuppressive_Main" width="100%"...
1
by: hackerslacker | last post by:
I have an ordering form that use two combo boxes to filter down the records of a Products table. This worked fine with the after_Update of the first filtering the records and creating the...
3
by: bobh | last post by:
Hi All, In AccessXP I put a option group control on a form and using vba I wrote Case logic. Neither the On-Click or the After Update event of the control kick off the vba code. What am I...
2
by: weston | last post by:
I have a form that has multiple option groups on it. When I created the form I copied the option groups and then changed the data source for them. But there now doesn't seem to be a caption for any...
1
by: EORTIZ | last post by:
I need to be able to delete a selection from an option group control in a form. In other words, if I selected value 1 from the option group control and I should have left blank this control.
4
by: JHite | last post by:
I am using Access 2003 on Windows XP. This is a simple database that contains “tblStaffers” containing names of the office staffers, “tblProjects” containing names of the office projects, and...
1
beacon
by: beacon | last post by:
Hi everybody, I've searched around for answers, but the closest thing I've found referenced the Northwind database and it seems to be set up a little differently than mine. I'm using DAPs (data...
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: 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: 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
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...
0
Oralloy
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.