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

Need to only run a module if the checkbox is checked

9 Byte
Sorry for lack of details, this is very new to me.

I have a large dataset. There is a table that has a column with the checkbox option. The table is created in the module's code. Some options in the table are selected with the checkbox and some are not. I want the records that are selected (checked) to be processed. My module runs on all the data in the set, but I want it to only run for the sets with the boxes checked. The key is figuring out how to filter the data so that only records with the check box checked for their area will be processed. The module is complex and I need to figure out how to filter what is processed.

Thanks!
Jul 8 '21 #1
8 5733
isladogs
455 Expert Mod 256MB
Welcome to the forum.
Whilst I'm sure that all makes sense to you, its not clear exactly what you are asking.
The BuildExhibit module may well be complex but apart from its name we know nothing about it.

Assuming you are referring to a field called Included then set a filter in your code/query for Included =True
Jul 8 '21 #2
NeoPa
32,556 Expert Mod 16PB
"Records that are included", "all the data", "the included box", "their area". All of these use real words yet none of them is explained in the context of your work or situation. IE. They're meaningless to anyone but you.

Please try to rewrite your question so it means something to the reader. That way we have a chance of helping you - and that's what we're here for and want to do.
Jul 8 '21 #3
brittaff
9 Byte
Thank you, I added more details. I have ever coded before and have been given a rather large project.
Jul 9 '21 #4
NeoPa
32,556 Expert Mod 16PB
Hi Brittaff.

That makes a little more sense. It's a bit garbled still to be fair but some of it's clearer at least and we do understand that knowing what to include is something you understand better with experience.

Now, I have to assume that somewhere in your code you open a Recordset object that's based on the table where the data is that you've described. This may be done passing a QueryDef object name or some SQL. Either way, to get a filtered set you'd need to include filtering. If you're using a QueryDef (Saved Query Object) then you need to ensure the QueryDef includes the Field which has a CheckBox and either True or <>False in the Criteria part. On the other hand if it's a SQL string then it must include a WHERE clause that specifies that Field not being False.

I hope this makes sense. We're still working in a large vacuum here as the items we need to talk about still don't have names. It's never as easy to understand what people are trying to tell you when the names aren't available.

If you're still struggling then I suggest you identify, and post for us, the line in your code where the Recordset that the code processes is opened. That will be very helpful as it has to include the names of the relevant objects. Names we need as much as VBA does in order to understand what you want.
Jul 9 '21 #5
brittaff
9 Byte
Here is the first area where the RecordSet function is used:

'Add "Statement" Line Numbers to table. (line numbers are not correct for Reinsurance Ceded line).
strSQL = ""
strSQL = strSQL & " SELECT Min(tblExhibitsTemplate.ID) AS FirstID, CoSort, AcSort, Ex5Sort"
strSQL = strSQL & " FROM tblExhibitsTemplate"
strSQL = strSQL & " GROUP BY CoSort, AcSort, Ex5Sort"
strSQL = strSQL & " ORDER BY CoSort, AcSort, Ex5Sort;"
Dim rsFirstId As Recordset
Set rsFirstId = MakeRecordSet(strSQL)
With rsFirstId
.MoveFirst
Do
strSQL = ""
strSQL = strSQL & " UPDATE tblExhibitsTemplate "
strSQL = strSQL & " SET LineNumber = Mid(Str(10000000+[Ex5Sort]*100000+([ID]- " & Str(!FirstId) & " +1)),3,7)"
strSQL = strSQL & " WHERE (CoSort=" & Str(!CoSort) & ")"
strSQL = strSQL & " AND (AcSort=" & Str(!AcSort) & ")"
strSQL = strSQL & " AND (Ex5Sort)=" & Str(!Ex5Sort) & ""
strSQL = strSQL & " ;"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
.MoveNext
Loop Until .EOF
End With
Set rsFirstId = Nothing
Jul 9 '21 #6
NeoPa
32,556 Expert Mod 16PB
Hi Britaff.

I'm not ignoring this, nor have I disappeared (except for the weekend where I was away at a wedding) so just to let you know I'll look at this again soon.

-Ade.
Jul 12 '21 #7
brittaff
9 Byte
Thanks Ade,

I have set up a query that runs through the table with the checkboxes and only prints a table with the items checked. My next step is to run another prewritten module for the table that was created from the query.
Jul 14 '21 #8
NeoPa
32,556 Expert Mod 16PB
I'm sorry I got distracted from this. Where are we now? Does your last comment mean you understand now & don't need help?
Aug 9 '21 #9

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

Similar topics

4
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! How do I convert a CheckBox.Checked to an int? Regards Martin Arvidsson
4
by: Michael Champagne | last post by:
We have an application to where you can select/deselect all checkboxes in a checkbox array by clicking a 'master' checkbox at the top of the screen. This seems to work fine unless there is only...
6
by: AFN | last post by:
I want to click a checkbox and have a 4 line (approx) paragraph appear beneath the checkbox, pushing the rest of the page down. And when unchecking the checkbox, the paragraph should disappear...
2
by: Andrew | last post by:
Hi, I have a problem capturing the checkboxes that are checked, I get false irrespective of wether they are checked or not. I have gone thru the sample code on this forum, but they dun seem to...
3
by: nologo | last post by:
All, Have a problem i just cant find the answer for. I'm trying to populate a colum in a SQL database. Basically the column requires a 1 or 0. I'm trying to populate this col via a c#...
2
by: poolboi | last post by:
hey guys, I've stored password in mysql using SHA1 encryption do i need the module digest::SHA1 when i'm verifying password for user put in?
4
by: srikanthia | last post by:
hi, im srikanth, i having a datagrid in that i have 5 checkboxes in windows application(C#.net) i want to check only one checkbox at a time and remaining should not be selected regards,...
1
by: neosp17 | last post by:
HI, I have sub form with checkbox as one checkbox column , name, total amount owned. Only one record from the sub form can be ticked (checked) Question: how to make only one checkbox ticked in sub...
5
by: Princess Zai | last post by:
how can i select only one checkbox from looped checkboxes in a form and get the value of the textbox corresponds to it. Example is I have an ID and a username, i will add a username, the ID is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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
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.