Hello All,
So I've got a form with multiple check boxes on it, the user makes selections on this form then clicks next, this opens a second form, on this form i would like to display text in an unbound text box based on the boxes the user has selected.
so if the user selects check box 1,5,and 7 i would like the text box to display:
1,5,7
Is this possible?
Thanks.
6 3178 twinnyfo 3,653
Recognized Expert Moderator Specialist
Xenver,
Yes, this is possible, but you would have to have a specific naming convention for your Check boxes, or have the number for the check box entered into the .Tag property of the checkbox.
You would simply build the string for your unbound text box by cycling through your checkboxes to see if they are checked: - Dim strValues As String
-
-
strValues = ""
-
-
If Me.chkBox1 then
-
If strValues = "" then
-
strValues = Me.chkBox1.Tag
-
Else
-
strValues = strValues & "," & Me.chkBox1.Tag
-
End If
-
end if
-
-
If Me.chkBox2 then
-
If strValues = "" then
-
strValues = Me.chkBox2.Tag
-
Else
-
strValues = strValues & "," & Me.chkBox2.Tag
-
End If
-
end if
-
-
. . . .
-
-
Me.txtBox = strValues
Hope this gets you moving in the right direction.
Hello,
Thanks yes this is very helpful. I think i can use this to do what i want to do but... this is a little embarrassing but i don't know where to enter the code... whenever I've used code before it's been in the code builder for an event (on click etc.) Thanks for the quick response too, everyone on this forum is so helpful!
Ok,so I'm using the code in an OnLoad event, and translated to use my forms names it looks like this: -
Private Sub Report_Load()
-
-
Dim strValues As String
-
-
strValues = ""
-
-
If [Forms]![frm_Reports Credit]![SS 1] Then
-
If strValues = "" Then
-
strValues = [Forms]![frm_Reports Credit]![SS 1]
-
Else
-
strValues = strValues & "," & [Forms]![frm_Reports Credit]![SS 1].Tag
-
End If
-
End If
-
-
If [Forms]![frm_Reports Credit]![SS 2] Then
-
If strValues = "" Then
-
strValues = [Forms]![frm_Reports Credit]![SS 2].Tag
-
Else
-
strValues = strValues & "," & [Forms]![frm_Reports Credit]![SS 2].Tag
-
End If
-
End If
-
-
-
Me.DisplayCredits = strValues
-
-
End Sub
-
-
-
but i get an error on line 15, it says :
"run-time error 94 invalid use of null"
Thanks.
twinnyfo 3,653
Recognized Expert Moderator Specialist
Check to make sure that your check box has the Triple State Property set to No. This property allows a Check box to have three values "True", "False" and "Null" (when a value has not been specifically assigned to it.
Hey,
I checked, and all the check boxes had their triple state property set to No, but for some reason when the form was first opened, until they were clicked they started with a blue fill, I'm guessing that indicated a null value because i went through and set all of their default values to 0 and the blue fill went away and everything works fine now. Thanks a lot!
twinnyfo 3,653
Recognized Expert Moderator Specialist
Glad we could be of some help. Let us know if you have any other questions.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: jeffsnox |
last post by:
Hi,
I have multiple checkboxes on the same form as follows:
<input type='checkbox' name='cbtype' value='1'>
<input type='checkbox' name='cbtype' value='2'>
<input type='checkbox'...
|
by: ramapv |
last post by:
can i highlight a checkbox from a group of checkbox with particular name which is given as a search key.
I am having a list of checkboxes and i have to select some of them and form a group.but i'm...
|
by: favor08 |
last post by:
I have a continious subform that 9000 + records and I have serveral
check marks on the subform. so it ties to that record.
Does anyone have any examples were they use multiple checkboxes in a ...
|
by: Ned Balzer |
last post by:
Hi,
Can anyone point me in the direction of a solution for validating
multiple checkboxes in an asp.net 2.0 page?
1) This is not a checkboxlist, it is a number of separate checkboxes
2) I do...
|
by: littlealex |
last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS!
In IE6 the text for the following page doesn't display properly - rather than being...
| |
by: JosAH |
last post by:
A Simple Text-Based Menu System
Read this this post; there are numerous posts like that: a newbie struggling with some sort of menu implementation. They want nested menus of course and an option...
|
by: kimmelsd33 |
last post by:
I am adding to my software. I have placed about 30 checkboxes on a form. Based on which checkboxes are selected, I want to print the values to a tab delimited text file. For instance, the first...
|
by: BabyLucifer666 |
last post by:
Hello All, (using Access2000)
I have a form with multiple unbound checkboxes. What I would like to do is have the user check whoever needs to take a specific training course. My database is...
|
by: pavan52 |
last post by:
I have 1 form in with multiple checkboxes in it (each with the code):
<input type="checkbox" value="$cat_tit" name="check_list" id="cat_title" />
How would I be able to tell which checkboxes...
|
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,...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |