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.
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.