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

checkbox values

lee123
556 512MB
i have on a form customers information and i have added a checkbox to the form to make visible these textboxes if additional information is needed for the customer.

question:

how do i make it if a customer needs the checkbox clicked the textboxes will show for only that customer and not all. you see i have an adodc control on the form that gets the information for the other textboxes with access (2000) for the backend. i have put buttons on the form to scroll through the records without using the adodc (which i have made invisible on the form) so when scroll through the records only the ones that have the checkbox checked should show and not all the records i hope i have made sense

I'm using Visual basic 6.0

thanks,
lee123
Jan 15 '08 #1
9 2713
Dököll
2,364 Expert 2GB
i have on a form customers information and i have added a checkbox to the form to make visible these textboxes if additional information is needed for the customer.

question:

how do i make it if a customer needs the checkbox clicked the textboxes will show for only that customer and not all. you see i have an adodc control on the form that gets the information for the other textboxes with access (2000) for the backend. i have put buttons on the form to scroll through the records without using the adodc (which i have made invisible on the form) so when scroll through the records only the ones that have the checkbox checked should show and not all the records i hope i have made sense

I'm using Visual basic 6.0

thanks,
lee123
Hello, lee123!

Just passing through making sure your post is not uinanswered, time zones that whole deal...

Unfortunately, I have a piece of code that queries using the like operator, but the idea is you'd need to add that customer's name to the textbox on the VB form then hit submit, the recordset, ADODC1 recordset, would get filled with only that customer's data, which you can page through.

I am still learning VB, I am not sure how to mastermind this into checkboxes. You let me, I 'll tell you what to do, guide you through.

Anything you have working by the way can be added for a closer by our experts here, may help shed some light:-)

In a bit!
Jan 15 '08 #2
Dököll
2,364 Expert 2GB
Hello, lee123!

Just passing through making sure your post is not uinanswered, time zones that whole deal...

Unfortunately, I have a piece of code that queries using the like operator, but the idea is you'd need to add that customer's name to the textbox on the VB form then hit submit, the recordset, ADODC1 recordset, would get filled with only that customer's data, which you can page through.

I am still learning VB, I am not sure how to mastermind this into checkboxes. You let me, I 'll tell you what to do, guide you through.

Anything you have working by the way can be added for a closer by our experts here, may help shed some light:-)

In a bit!
I was thinking lee123, perhaps your checkboxes can act as your submit button, get it. If we add the code under the checkbox and not the submit button, you would in fact be querying for that customer.

I may be way off:-)
Jan 15 '08 #3
Killer42
8,435 Expert 8TB
If I'm reading the question correctly, you just want the textboxes to appear or disappear automatically as you scroll through the records, based on the value of a field (which is displayed as a checkbox).

You should be able to do so by coding in the appropriate event procedure on the data control. Not sure exactly which event, though. I seem to recall there are ones which are fired when you move between records, before/after the record is displayed, and so on. I may be getting mixed up with forms in MS Access, though. I do know the built-in data control has a Reposition event.

Another alternative might be to just watch for a change in the value of the checkbox - either by using an event procedure of the control, or a timer.
Jan 15 '08 #4
lee123
556 512MB
Hey killer42 & Dokoll:

thanks for getting back with me you two. but killer42 you have hit the nail on the head (sorta speak) i have put a code in the form_load because in access i think you have to do this and put the code in the checkbox also. but i tried in my form (vb) but when i scrolled through the records the checkbox was checked on all and not just the ones i have checked but i'll try this what you have stated. i'll get back with you and tell you if it worked or not.

thanks,
lee123
Jan 15 '08 #5
lee123
556 512MB
oh just so you have an idea what i have in the checkbox here it is:

Expand|Select|Wrap|Line Numbers
  1.  If Check2.Value Then
  2.         txtVehicle2.Visible = True
  3.         txtVehicle3.Visible = True
  4.         Label21.Visible = True
  5.         Label22.Visible = True
  6.         Label17.Visible = True
  7.         txtHowManyVeh.Visible = True
  8. Else           
  9.         txtVehicle2.Visible = False
  10.         txtVehicle3.Visible = False
  11.         txtHowManyVeh.Visible = False
  12.         Label21.Visible = False
  13.         Label22.Visible = False
  14.         Label17.Visible = False
  15.     End If
Thanks,
lee123
Jan 15 '08 #6
lotus18
866 512MB
oh just so you have an idea what i have in the checkbox here it is:

Expand|Select|Wrap|Line Numbers
  1.  If Check2.Value Then
  2.         txtVehicle2.Visible = True
  3.         txtVehicle3.Visible = True
  4.         Label21.Visible = True
  5.         Label22.Visible = True
  6.         Label17.Visible = True
  7.         txtHowManyVeh.Visible = True
  8. Else           
  9.         txtVehicle2.Visible = False
  10.         txtVehicle3.Visible = False
  11.         txtHowManyVeh.Visible = False
  12.         Label21.Visible = False
  13.         Label22.Visible = False
  14.         Label17.Visible = False
  15.     End If
Thanks,
lee123
Hey You had forgotten to add value to a checkbox. Minimizing the codes:

Expand|Select|Wrap|Line Numbers
  1. Public Sub CheckValue(a As Boolean)
  2.       txtVehicle2.Visible = a
  3.       txtVehicle3.Visible = a
  4.       txtHowManyVeh.Visible = a
  5.       Label21.Visible = a
  6.       Label22.Visible = a
  7.       Label17.Visible = a
  8. End Sub
  9.  
  10. If Check2.Value=1 Then
  11.     CheckValue True
  12. Else
  13.     CheckValue False
  14. End If
  15.  
Rey Sean
Jan 15 '08 #7
Killer42
8,435 Expert 8TB
Oh, so we want to minimise code, do we? :) Well, I'll take that challenge.

Without changing your CheckValue sub...
Expand|Select|Wrap|Line Numbers
  1. CheckValue (Check2 <> 0)
Jan 15 '08 #8
Killer42
8,435 Expert 8TB
lee123, anything you put in the Form_Load event procedure will only be executed once, when the form is loaded. You need to use an event which will occur at the point you are interested in . That is, when you change records.
Jan 15 '08 #9
daniel aristidou
491 256MB
lee123, anything you put in the Form_Load event procedure will only be executed once, when the form is loaded. You need to use an event which will occur at the point you are interested in . That is, when you change records.
Could you not use the textbox.textchanaged event on the textbox containing the primary key........ wait im not sure whether that is vb6..,,,
Jan 16 '08 #10

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

Similar topics

6
by: Angelos | last post by:
I have this list of logs stored in a MySQL DB. I display them in a list and next to each log I have a del view LINK I want to add Checkboxes next to each log and keep del and view links as...
4
by: Jack | last post by:
Hi, I have a checkbox the value which goes to a database via a asp page that builds the sql string. In the front end asp page, the checkbox code is written as follows: <i><input...
4
by: Vanessa | last post by:
I have an ASP script which is used to upload files with Persits.Upload.1 object. But I can't get the values from mutliple checkboxes in the form like normally. <form method="post"...
1
by: J Talbot | last post by:
Hi Was wondering if anyone could help me with this problem : If I have three checkboxes with different values on a form like : <input type="checkbox" name="checkbox" value="1stValue">...
6
by: Chuck Anderson | last post by:
My knowledge of JavaScript is limited. I learn from example and then adapt those examples to suit my needs. I have stumped myself on this one. I have a form with checkboxes that I want to...
29
by: Amer Neely | last post by:
I've got a dynamically built form with checkboxes for each element ( a list of file names in a directory). I need to grab only those checkboxes that are checked, so I can then delete those files. ...
4
by: Matt | last post by:
I am no JavaScript guru so please bear with me and be as detailed as possible with your response. I thank you in advance. I have an ASP page that contains form elements. I also have an inline...
0
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me...
10
by: LionsDome | last post by:
Hello, I have a vb.net page which a bunch of checkboxes. A user can select a checkbox(s) and hit the submit button to store those values in a SQL Server table. This works fine with no problem...
9
by: raamay | last post by:
I have six checkboxes as shown below: <table> <tr> <td><input name="spec1" type="checkbox" value="0" tabindex="11" /><label id="label">Bridge Construction</label></td> </tr> <tr> <td><input...
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
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...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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

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.