multiple check boxes

R

Ross

I have a form I have created that will print out on an 8.5 X 11 paper the
top half of the form -- the part I want to fill in -- is an exact duplicate
of the bottom half and I want the bottom half to be fill in as the top half
is, automatically. I know how to do this with cells in the spreadsheet, but
there are various check boxes as well and I cannot figure out how to make
say checkbox 29 in the lower half, which is the counterpart of checkbox6 in
the upper half become checked when I click on checkbox 6. I know there must
be an easy way to do this. right? Thanks in advance for any help

Ross
Visit my page at:
www.ssor.net
 
W

Wolfgang Kais

Hello Ross.

Ross said:
I have a form I have created that will print out on an 8.5 X 11
paper the top half of the form -- the part I want to fill in --
is an exact duplicate of the bottom half and I want the bottom
half to be fill in as the top half is, automatically.
I know how to do this with cells in the spreadsheet, but there are
various check boxes as well and I cannot figure out how to make say
checkbox 29 in the lower half, which is the counterpart of checkbox6
in the upper half become checked when I click on checkbox 6.
I know there must be an easy way to do this. right? Thanks in advance for
any help

If I got you right:
You can use an event procedure fired from the AfterUpdate event of
Checkbox6, that contains a line like this:
Checkbox29.Value = Checkbox6.Value
 
G

Guest

Ross,

First, I would suggest that you rename your controls. Renaming your controls
will help you to visually recogonize your controls and even remember which is
which.

Now, for the answer to your question.

Use the After Update event of "checkbox 6". Use code like this:

If Me.NameOfCheckBox6 = -1 then
Me.NameOfCheckBox29 = -1
Else
Me.NameOfCheckBox29 = 0
End If
 
R

Ross

Thanks Mr. B,
I am a beginner here, so I am sure I didn't do this right. I didn't
want to go through renaming all the click boxes, as they are numbered from 1
to over 100, half in the top form and half in the bottom. Here is the macro
I wrote. It did't work. When I clicked checkbox 6 and put a check in it
and then ran the macro below, checkbox 88 (the one that corresponds to 6,
remained blank
Also, I don't know what the "After Update event " is.
Question: Am I allowed to attach a copy of the spreadsheet in question to
posts here?
Ross

Sub clicbox()
'

If CheckBox6 = -1 Then
CheckBox88 = -1
Else
Me.CheckBox88 = 0
End If
End Sub

----- Original Message -----
From: "Mr B" <draccess at askdoctoraccess dot com>
Newsgroups: microsoft.public.access.forms
Sent: Friday, October 05, 2007 7:52 AM
Subject: RE: multiple check boxes


| Ross,
|
| First, I would suggest that you rename your controls. Renaming your
controls
| will help you to visually recogonize your controls and even remember which
is
| which.
|
| Now, for the answer to your question.
|
| Use the After Update event of "checkbox 6". Use code like this:
|
| If Me.NameOfCheckBox6 = -1 then
| Me.NameOfCheckBox29 = -1
| Else
| Me.NameOfCheckBox29 = 0
| End If
|
| --
| HTH
|
| Mr B
| askdoctoraccess dot com
|
|
| "Ross" wrote:
|
| > I have a form I have created that will print out on an 8.5 X 11 paper
the
| > top half of the form -- the part I want to fill in -- is an exact
duplicate
| > of the bottom half and I want the bottom half to be fill in as the top
half
| > is, automatically. I know how to do this with cells in the spreadsheet,
but
| > there are various check boxes as well and I cannot figure out how to
make
| > say checkbox 29 in the lower half, which is the counterpart of checkbox6
in
| > the upper half become checked when I click on checkbox 6. I know there
must
| > be an easy way to do this. right? Thanks in advance for any help
| >
| > Ross
| > Visit my page at:
| > www.ssor.net
| >
| >
| >
 
G

Guest

Ross,

No, you are not allowed to attach files to the newsgroups. I am a little
concerned in that Access does not have spresdsheets. I hope you are talking
about something else. I assumed that we were talking about a form in MS
Access.

As for the renaming idea: You certainly do not have to rename your controls,
it was only a suggestion.

Each of your controls have multiple events that can be used to cause code to
be executed.

To locate the AfterUpdate event for a specific control, first select the
control by clicking on it. Then right click over the selected control and
select the Properties option from the shortcut menu. When the Properties
dialog box is presented, click on the Event tab. Locate the After Update
event line. Double click in this line to the right of the After Event name.
The following entry will appear in the line: [Event Procedure]

Next, with your cursor in this line, click the button with the three dots at
the end of the line. The VBA code window will be presented and you should
see code like:

Private Sub Check8_AfterUpdate()

End Sub

The "Check8" at the beginning of the sub definition above will be named for
your selected control. You can add your code in between these two lines.

Just so you'll know, the statement that Wolfgang provided can be used in
place of my If statement. I am just used to using an If statement because I
would normally need to make other actions to take place based on the
condition of the check box.

Once you have the desired code in between the Sub definition, save your form
and give it a try.
 
R

Ross

Sorry, I thought I was on Excel newsgroup. Sorry
Mr B said:
Ross,

No, you are not allowed to attach files to the newsgroups. I am a little
concerned in that Access does not have spresdsheets. I hope you are
talking
about something else. I assumed that we were talking about a form in MS
Access.

As for the renaming idea: You certainly do not have to rename your
controls,
it was only a suggestion.

Each of your controls have multiple events that can be used to cause code
to
be executed.

To locate the AfterUpdate event for a specific control, first select the
control by clicking on it. Then right click over the selected control and
select the Properties option from the shortcut menu. When the Properties
dialog box is presented, click on the Event tab. Locate the After Update
event line. Double click in this line to the right of the After Event
name.
The following entry will appear in the line: [Event Procedure]

Next, with your cursor in this line, click the button with the three dots
at
the end of the line. The VBA code window will be presented and you should
see code like:

Private Sub Check8_AfterUpdate()

End Sub

The "Check8" at the beginning of the sub definition above will be named
for
your selected control. You can add your code in between these two lines.

Just so you'll know, the statement that Wolfgang provided can be used in
place of my If statement. I am just used to using an If statement because
I
would normally need to make other actions to take place based on the
condition of the check box.

Once you have the desired code in between the Sub definition, save your
form
and give it a try.

--
HTH

Mr B
askdoctoraccess dot com


Ross said:
Thanks Mr. B,
I am a beginner here, so I am sure I didn't do this right. I didn't
want to go through renaming all the click boxes, as they are numbered
from 1
to over 100, half in the top form and half in the bottom. Here is the
macro
I wrote. It did't work. When I clicked checkbox 6 and put a check in it
and then ran the macro below, checkbox 88 (the one that corresponds to 6,
remained blank
Also, I don't know what the "After Update event " is.
Question: Am I allowed to attach a copy of the spreadsheet in question to
posts here?
Ross

Sub clicbox()
'

If CheckBox6 = -1 Then
CheckBox88 = -1
Else
Me.CheckBox88 = 0
End If
End Sub

----- Original Message -----
From: "Mr B" <draccess at askdoctoraccess dot com>
Newsgroups: microsoft.public.access.forms
Sent: Friday, October 05, 2007 7:52 AM
Subject: RE: multiple check boxes


| Ross,
|
| First, I would suggest that you rename your controls. Renaming your
controls
| will help you to visually recogonize your controls and even remember
which
is
| which.
|
| Now, for the answer to your question.
|
| Use the After Update event of "checkbox 6". Use code like this:
|
| If Me.NameOfCheckBox6 = -1 then
| Me.NameOfCheckBox29 = -1
| Else
| Me.NameOfCheckBox29 = 0
| End If
|
| --
| HTH
|
| Mr B
| askdoctoraccess dot com
|
|
| "Ross" wrote:
|
| > I have a form I have created that will print out on an 8.5 X 11 paper
the
| > top half of the form -- the part I want to fill in -- is an exact
duplicate
| > of the bottom half and I want the bottom half to be fill in as the
top
half
| > is, automatically. I know how to do this with cells in the
spreadsheet,
but
| > there are various check boxes as well and I cannot figure out how to
make
| > say checkbox 29 in the lower half, which is the counterpart of
checkbox6
in
| > the upper half become checked when I click on checkbox 6. I know
there
must
| > be an easy way to do this. right? Thanks in advance for any help
| >
| > Ross
| > Visit my page at:
| > www.ssor.net
| >
| >
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top