473,396 Members | 2,151 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.

Setting the Value of a Checkbox with VBA

Hi, I am basically a self taught programmer and so many of my solutions are often 'quick and dirty' but this has me stumped.

I have a Student Entry Form that finishes with 4 checkboxes. On entry a form pups up asking a Y/N question. If the user clicks yes the macro sets the value of the checkbox to Yes and shifts to the next field. If No it just shifts to the next field. The problem I have is that at an earlier stage I had to force a save to validate certain data. This works fine as the error opens a form to ask if these are twins. If Yes it sets the value of the Twins Checkbox and proceeds. However, and this is the problem, when it gets to the Checkboxes it has a problem with the already ticked cb (Twins). The preceding cb (Identification) pops up its form and if you answer no it passes to (Twins) which generates an error (unable to move focus to control). In the VBA code I have solved this by changing the error procedure to GoToControl "Health", so that the error actually helps the flow of the program. I want to do the same with the Yes button but I can't get the VBA code to set the cb value so I have to use a Macro Setvalue but then I can't force it to proceed to Health if (Twins) is already checked. I get a can't move to control error. So please someone tell me how to set a value for a checkbox in VBA. I have tried Yes, True and -1 all to no avail using Identification =. The convert Macro to VBA changes it to Identification = True but that still doesn't work.
Sep 28 '16 #1
0 970

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

Similar topics

3
by: JKop | last post by:
Consider the following platform: char = 8-bit short = 16-bit int = 32-bit long = 32-bit
0
by: CSDunn | last post by:
Hello, I have a subform where the 'Name' and 'Source Object' properties are both 'frmSelectByTestSUB'. This subform resides in a main form called 'frmSelectByTest'. In the subform, I have a...
0
by: swapnil | last post by:
Hi , i am using UltraGrid in my application and assigning a DataTable to it as a DataSource. I am having 1 column in that dataTable of type String of size 1, where string will be stored as F or T...
2
by: C | last post by:
Hi, Based on a flag in my database table I want to make a server side checkbox checked. How can I dynamically do this through code? Thanks, C
1
by: George | last post by:
I am trying to set the value of items in a dropdown list dynamically, and can't seem to figure out how to do it. I have two arrays set up like this: Dim a() as string ={"A", "B", "C"} Dim b()...
6
by: Rick | last post by:
I have a main form called frmDemo with a subform frmStageTrack_Sub. On the subform is a Combo Box CboTermID. The frmDemo is tied to tblDemo and the frmStageTrack_Sub is tied to tblStageTrack. ...
0
by: John | last post by:
Hi, I have set a DataGridViewComboBoxColumn for a complex object type, and set the DisplayMember and ValueMember to members of the object type. My problem is how to programmatically set the cell...
11
by: arggg | last post by:
I have a statusbar and created a textbox to double test this however the value is being sent as I did a MessageBox.Show(value); and it shows the value being passed yet it is not being set. Can...
2
by: mbalas2 | last post by:
I set the value of Total texbox through javascript, and Total texbox does show the changed value. But when i access the textbox while saving in the db, the value is reset to previous value (value...
3
maylortaylor
by: maylortaylor | last post by:
I'm writing a VB console program that will run a function at a certain time of day. This is what i have so far. Sub Main() Dim backupTime As String backupTime = My.Settings.backupTime...
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
jinu1996
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...
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.