473,385 Members | 1,861 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.

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 1209

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...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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...

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.