473,320 Members | 1,821 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,320 software developers and data experts.

many controls

553 512MB
Hi,

If there are so many controls on a form - check boxes, radio buttons, texboxes, etc.

How can i know if any of these are changed - thier value changed, etc

If any of these is changed ... then do something.

Thanks
Jul 27 '07 #1
7 2354
Twanne
65
Right click on the item and add some code. Something like build... I think (in dutch is "gebeurtenis opbouwen")
Jul 27 '07 #2
questionit
553 512MB
Twanne

I said i have items not just a single item.

There are 10s of controls , how can you set onChange event or something with everyone ?

Ofcouse a better method is needed

Right click on the item and add some code. Something like build... I think (in dutch is "gebeurtenis opbouwen")
Jul 27 '07 #3
missinglinq
3,532 Expert 2GB
Is there one thing you want to do if any of the controls change, or are there different things you want to do, depending on which controls change?

Linq
Jul 27 '07 #4
questionit
553 512MB
I want to do one thing if any of the controls change

Is there one thing you want to do if any of the controls change, or are there different things you want to do, depending on which controls change?

Linq
Jul 27 '07 #5
missinglinq
3,532 Expert 2GB
This will immediately run the code with the input of a single character into any field
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Dirty(Cancel As Integer)
  2.  'Code to run goes here
  3. End Sub
  4.  
This will run the code when the record is saved if a single character has been entered into any field
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2.  'Code to run goes here
  3. End Sub
  4.  
If you only want the code to run when a record is being edited, not when a new record is being entered, use this code
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2.  If Not Me.NewRecord Then
  3.   'Code to run goes here
  4.  End If
  5. End Sub
  6.  
  7. Private Sub Form_Dirty(Cancel As Integer)
  8.  If Not Me.NewRecord Then
  9.   'Code to run goes here
  10.  End If
  11. End Sub
Linq
Jul 27 '07 #6
questionit
553 512MB
HI Linq

The code you have give works fine. What if i want to check other things like change of check-box value or radio button value?

If their value change then do something ......Again i have so many of these on the form.

Thanks

This will immediately run the code with the input of a single character into any field
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Dirty(Cancel As Integer)
  2.  'Code to run goes here
  3. End Sub
  4.  
This will run the code when the record is saved if a single character has been entered into any field
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2.  'Code to run goes here
  3. End Sub
  4.  
If you only want the code to run when a record is being edited, not when a new record is being entered, use this code
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2.  If Not Me.NewRecord Then
  3.   'Code to run goes here
  4.  End If
  5. End Sub
  6.  
  7. Private Sub Form_Dirty(Cancel As Integer)
  8.  If Not Me.NewRecord Then
  9.   'Code to run goes here
  10.  End If
  11. End Sub
Linq
Jul 31 '07 #7
missinglinq
3,532 Expert 2GB
The code you've got will work for any change in your record, including checkboxes and radio buttons. If you want to perform something when the value of a particular control (checkbox, radio button or whatever) you have to put the code in the BeforeUpdate sub for the particular control.
Jul 31 '07 #8

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

Similar topics

6
by: SamIAm | last post by:
Hi am creating a email application that needs to mail out a very large amount of emails. I have created a multithreaded c# application that using message queuing. I have created a threadpool of 5...
8
by: Rachel Suddeth | last post by:
I have an application where some forms have many (say 100) UserControls on them (each of which contain a label, an image, and a data entry control), and each UserControl has a ToolTip provider...
3
by: Tom | last post by:
I am writing a Visual basic .Net database application. There are many forms that first let you select and look at a DB record and then when you click a "modify" button you are allowed to change...
4
by: Jan Nielsen | last post by:
Hi all I'm a former Access developer who would like to implement a many-to-many relation in about the same way you do in Access: With a subform and a combo box. Is it possible to use a...
6
by: Gary Kahrau | last post by:
I am planning a very large project in vb.net and I want to make it modular. If the project needs 200-300 forms what do you think about creating a user control for each of these forms? The main...
5
by: kaosyeti | last post by:
hey.. i have a report that is based on a 12 field simple query. i've been working on it for a while and had to restart some areas so i know i went over the 755 control limit but only until i reset...
5
by: BLACKDOG157 | last post by:
I've made a form with a variable number of textboxes. The user fills them out, and then I need to pick up the values he has filled in. The number of textboxes vary depending on a value that the...
2
by: Mohammad Hashemian | last post by:
Hello In writing an application I should design an options form like the MS Office Options form. this form has too many controls in some tab pages. the problem is when I add these controls to the...
2
by: ngr | last post by:
I have come across a problem because I have too many controls on a form. It says that it cannot create a handle. Now I know that there is a limit of how many windows handles which can be used...
3
by: rossmclean | last post by:
Hi, I am trying to add "x" number of DGV controls at run time. In my app the user selects a dir with a number of mdbs in it. They then select which dbs they want to run a common SQL against. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.