Check box help

Ed in Aus

Registered User.
Local time
Tomorrow, 03:00
Joined
Oct 21, 2008
Messages
14
Ok this is what I want, user clicks on one check box labelled Concretor when the check box is clicked 4 more check boxes appear in the form i.e. FinisherFormworkPouringScreeding

Does anyone know how to do that? I was thinking something like tagging the sub-checkboxes as concretor then when concretor is updated make the sub-boxes visible.

Also I am open for any idea to resolve this.
 
In the after update event of the checkbox labeled Concretor, you can put:

Code:
With Me
    .Finisher.Visible = .Concretor
    .Formwork.Visible = .Concretor
    .Pouring.Visible = .Concretor
    .Screeding.Visible = .Concretor
End With
 
Oh, and you will want that code in the form's On Current event too.
 
Ah I see, but I cannot find the on current event? is that just on click or something?

Got it to work with the on click event works like a dream cant see it really playing up... I will need to make extra code to check if any of the other check boxes have been checked on also.
 
Ah I see, but I cannot find the on current event? is that just on click or something?.
The form's On Current event is available by selecting FORM from the drop down in the VBA window (on the left side in the VBA window) and then selecting CURRENT from the drop down on the right side.
 
Still can't find it... its working either way... also if anyone wanted to see the code here it is..

Code:
Private Sub Concreting_Click()
If Me.Finisher Or Me.Formwork Or Me.Pouring Or Me.Screeding = True Then
MsgBox "You have selected some of the concreting spcific trades"
Exit Sub
End If
With Me
    .Finisher.Visible = .Concreting
    .Formwork.Visible = .Concreting
    .Pouring.Visible = .Concreting
    .Screeding.Visible = .Concreting
    .lblFinisher.Visible = .Concreting
    .lblFormwork.Visible = .Concreting
    .lblPouring.Visible = .Concreting
    .lblScreeding.Visible = .Concreting
End With
End Sub
 
See the attached jpgs for the current event.
 

Attachments

  • 01SelectForm - Copy.jpg
    01SelectForm - Copy.jpg
    49.4 KB · Views: 75
  • 02SelectCurrent - Copy.jpg
    02SelectCurrent - Copy.jpg
    75.6 KB · Views: 83
Ok looks like it is meant to be there but it is not showing up... any ideas why it would not be showing up?

an if you hadn't guessed new to access but know a little bit of code.
 

Attachments

  • no_current.GIF
    no_current.GIF
    29.7 KB · Views: 70
Ok looks like it is meant to be there but it is not showing up... any ideas why it would not be showing up?
Yes, it isn't showing up because you've selected CONCRETING in the left side instead of FORM. FORM is the word to select. Not the form name, not a control name, but the actual word FORM as shown in my first screenshot.
 
Thank you for that was thinking I was going crazy... this may end up being complicated as I need to do it for around 10 sets of trades, each with 3 - 5 sub sets...

Now I know how to do the first part I have realised that my second part well its not doing everything I want it too.

When the sub boxes are all check off (after the check from the main code runs) I need the sub sets to be not visible again.

I hope they don't want to change these trades that often... this is why I was leaning towards using tags for each of the sub check boxes and their Labels.

Do you know how to use the tags to switch them on and off? like a group on and of check box? with the check in the subsets if one is selected when you are switching it off?

I cannot thank you enough for what you have already given me saved me a few days of googling already
 
Well, first of all, using the form's Current event will turn things on or off based on the value of the concreting checkbox in each record.

But, if you want to use tags, you can set them in design view (something like group1 for instance).

Then you can use:

Code:
Dim ctl As Control
 
For Each ctl In Me.Controls
  If ctl.Tag = "group1" Then
     ctl.Visible = Me.Concreting
  End If
Next ctl
 
Ok have it mapped to an ID record so doing it for each rocord might not be the way to go... but will have some great uses for it in other places.

and for the tag part... bravo never knew it was that easy.

Thanks heaps mate.
 
Good luck with getting it all the way you want. :)
 

Users who are viewing this thread

Back
Top Bottom