Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CheckBoxes and continuous forms

Status
Not open for further replies.

kr32

Technical User
Jun 22, 2017
4
AU
Hi,
Just wanted to know if its possible to use a check box to control individual records on a continuous form. When you check it checks all the records. The checkbox is a bound control.

I have two command button to select two different forms. and I wanted to be able to select either per check box, with the other command button invisble.
This is what i have code I have used.
Code:
Private Sub PrintSch_BeforeUpdate(Cancel As Integer)
If Me.PrintSch = True Then
Me.Schedule1.Visible = True
Me.Schedule2.Visible = False
Else
Me.Schedule1.Visible = False
Me.Schedule2.Visible = True

End If
End Sub

However it just changes both command buttons at the same time..
Any ideas would be appreciated.

Thank you.

KP

 
I really don't see anything in your code that mentions check boxes or command buttons. Can you be a little more explicit for those of us who can't see your form's design?

Duane
Vevey, Switzerland
Hook'D on Access
MS Access MVP 2001-2016
 


Hi Duane,
Thanks for your reply.
The control source and name for the Checkbox is (PrintSch) and the command buttons are,
1. Schedule1
2. Schedule2

Code:
Private Sub PrintSch_BeforeUpdate(Cancel As Integer)
If Me.PrintSch = True Then
Me.Schedule1.Visible = True
Me.Schedule2.Visible = False
Else
Me.Schedule1.Visible = False
Me.Schedule2.Visible = True

End If
End Sub

All set up on a continuous form.So when the checkbox is selected per record either Command button can be visible not both together. I have them on top of each other so only one can be seen at a time.

Thank you

 
Command buttons are unbound controls so each row in your continuous form will display exactly the same. They are the same control and share the same properties. Some controls support conditional formatting so their appearance can change.

Duane
Vevey, Switzerland
Hook'D on Access
MS Access MVP 2001-2016
 
You may also do yourself a favor - and to anybody who looks at your code - and use widely accepted naming conventions for naming your controls, like [tt]chkPrintSch[/tt] for a checkbox, and [tt]cmdSchedule1[/tt] and [tt]cmdSchedule2[/tt] for command buttons.

Have fun.

---- Andy

There is a great need for a sarcasm font.
 
You may be able to fake this, but the "buttons" would have to be side by side. You could make two text box look like a button by making it raised and locked. Then use conditional formatting to enable/disable. You can make it also "invisible" by formatting the background and foreground the same as the form color.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top