Hi,I have say 10 checkbox in my form. In which i should be able to select only 2 checkboxes. Once 2 checkbox are selected then the remaining checkboxes should be disabled. And which ever checkboxes are selected, those checkboxes should fetch the data from the different excel sheets and place it in the 2 frames which are designed below.(Each frames consists of some more checkbox. But i am facing the issue when the checkbox are checked.
Please help me developing this.
Thanks
This code will disable the checkboxes when 2 of them are selected.
When one of the selected is unchecked: all the checkboxes are again available. 14 13558
This code will disable the checkboxes when 2 of them are selected.
When one of the selected is unchecked: all the checkboxes are again available.
Here's a simpler version. To try it out, create a new form and put an array of checkboxes on it. Then paste this code into the code area of the form. (Control arrays make your code much shorter and simpler.) -
Option Explicit
-
DefLng A-Z
-
-
' How many are currently checked.
-
Private NumChecked As Long
-
-
' Maximum number that may be checked before locking.
-
Private Const CheckLimit As Long = 2
-
-
Private Sub Check1_Click(Index As Integer)
-
Dim I As Long
-
If Check1(Index).Value Then
-
NumChecked = NumChecked + 1
-
If NumChecked >= CheckLimit Then
-
For I = Check1.LBound To Check1.UBound
-
Check1(I).Enabled = False
-
Next
-
End If
-
Else
-
NumChecked = NumChecked - 1
-
End If
-
End Sub
-
Thanks alot. This helped me solving the checkbox issue. But my other issue is that, Once 2 checkboxes are select i should get only data of the checkboxes selected in the frames below those 10 checkboxes.
For Example:Say 10 checkboxes are the name of the fruits, once i select 2 checkboxes i should get the data present in different sheet.
Please help me with this. And i have 2 frames in which there are checkboxes.
First a question: in which version are you working?
Because my solution was for Office 2003 (no indexes can be used in VBA)
or Office 2008, 2010, ...?
To get the data in the form: put the data from the sheets (columns) in an array and paste the array in the form.
Is it possible to attach your workbook in Bytes?
If it's to large, just a part of the data so we can see what your layout is and we can work on the same sheets with data.
If the information on the sheets is confidential, please enter fictive data!
Hi. I am working on Office 2010. I didnt understand how to make use of array in this case. Yes the data confidential. I will try giving you an example, you can help me to solve this issue. I will attach the file after this mail.
I have designed a simple form, which has 5 different branded clothes. Once i select 2 brands and click "Next" button, it will show the frame bellow and gets the data from the excel sheet. But i have only written the code for the first 2 check boxes. I can select any number of options bellow and click on "Go" button, in the next sheet i should to that particular and get the data. May this would help you to understand my issue. I know its a very simple code. Please help me doing this.
I am attaching a file with this reply
The checkboxes in the frames, is this for the columns to select?
Attached is a first solution.
Is this OK so far for this call?
If so, and you want more help on this project, please open an other call with an other name like "transfer data from sheets" or something like that.
This to prevent that a whole project with different problems is classified under one call with name "Enable and disable checkbox"
Hi. Thanks alot, it really helped me. But i have one more issue now. You remember i had sent a file from where the data is coming from different sheets. I am unable to do that. Because once the data in the first sheet changes, it should also change in the next sheet. I mean once i click on button "Go" it should get the data in the next form. Where in the selection in Frame_1_1 and Frame_1_2 can be multiple or can be individually selected. Please provide me some soultion to it.
Thanks
Hi. I have to another doubt. I have a file where the data is scattered. I have to map that data into flat format, so that it could be uploaded in the server. Doing that manually will take much time. Is it possible for you to provide any solution for this.
Thanks and Regards,
Zakeer
I am sorry i didnt read your mail properly. As i was in a hurry. And i am really very sorry for replying late. And thank you very for support.
Hi, My other doubt is i have a invoice where the data is from different sheets. In the first sheet i have total price in each module. And going forward i have different sheets where each module is break down and providing the amount for each module in detail. I have collect the data from all the sheets and populate in a single sheet, which would be flat file with all the details.
Please help me doing this.
If required i will send a example file.
Please open an other call with an other name like "transfer data from sheets" or something like that.
This to prevent that a whole project with different problems is classified under one call with name "Enable and disable checkbox".
In the meantime I will see what I can do.
Is it possible to attach an example of the sheets with data (e.v. with fictive values) and an example of the result you want?
Tranfer data between Sheets
Hi. Thanks alot, it really helped me. But i have one more issue now. You remember i had sent a file from where the data is coming from different sheets. I am unable to do that. Because once the data in the first sheet changes, it should also change in the next sheet. I mean once i click on button "Go" it should get the data in the next form. Where in the selection in Frame_1_1 and Frame_1_2 can be multiple or can be individually selected. Please provide me some soultion to it.
Yes sure. I will provide the example file. I shall attach that with the next mail, which i will send you.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: HolaGoogle |
last post by:
Hi all,
Can you please tell me what's wrong with my code??? i do have this
database in wich i have to field.One is a "yes/no" field and another
one is "number" field. To display the yes/no field...
|
by: HolaGoogle |
last post by:
Can you please tell me the right way to do this?? it's realy
important! thanks in advance...
Hi all,
Can you please tell me what's wrong with my code??? i do have this
database in wich i have...
|
by: Bob Bedford |
last post by:
I've this code:
function checkdate(FormSubmit){
alert(document.getElementById('Mois').value);
if(eval(document.getElementById('Mois'))>0 &&
eval(document.getElementById('Annee'))>0){...
|
by: Alphonse Giambrone |
last post by:
I am trying to enable/disable a requiredfieldvalidator on the client side
and am generating an error.
I had found some documentation on validation which states that I should be
able to...
|
by: hortoristic |
last post by:
We are using JavaScript to Enable/Disable certain fields on web pages
based on business rules.
A simple example is if when using an option type tag, and the two
options are Yes and No. If YES...
|
by: sheldonlg |
last post by:
I have a checkbox that I set by php code to be either "checked" or "".
I want to disable the ability of the user to check or uncheck it. I
tried "readonly", but that didn't work. Any suggestions?
|
by: RootSpy2006 |
last post by:
Hi All,
Problem Definition:
---------------------
Microsoft Wirelss Keyboard works in BIOS but does not work when booting into
windows.
Discovered Work-around:
-----------------------------...
|
by: Naushad |
last post by:
Hi all,
I am using the countinous form. I want to Enable/Disable the some
fields for perticular records as per the following condition when
open the form. I have written this code in "On Current...
|
by: rash007 |
last post by:
I am building up a table in php built from an array in a database. I can assign each row its own id's etc. But I need to enable or disable checkbox buttons and a text area depending on the checkbox...
|
by: sanndeb |
last post by:
I want to enable/disable controls of a asp.net page against a logged in user's permission. say 'admin' & 'hr' can change user's birth date text-box in a page but others will see the text-box as...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
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...
|
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,...
| |