HELP - Tick box to refresh form (1 Viewer)

whybrow23

Registered User.
Local time
Today, 01:55
Joined
May 20, 2011
Messages
38
Hi all

I'm in need of some help.

I have a form that has some tabs and by default they are hided. If I then tick a check box and go to the next record and back again the tab appears - This is great

But.......

I was wondering if there is a way for when I click on the tick box, the tab would appear without me having to go to another record and back again for it to appear??

Thanks
 

isladogs

MVP / VIP
Local time
Today, 01:55
Joined
Jan 14, 2017
Messages
18,221
Hard to tell based on what you have told us.
Perhaps you just need to save the current record.

Try adding this line to force a save
Code:
If Me.Dirty Then Me.Dirty =False
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:55
Joined
May 7, 2009
Messages
19,242
Or you can add code to the tickbox click event.
 

whybrow23

Registered User.
Local time
Today, 01:55
Joined
May 20, 2011
Messages
38
Not sure how to explain it better.......

So I have a form, within that form I have some tab pagers.

By default 2 of the tabs don't appear. To make them appear you have to tick a tickbox, but the only way I can get the tab/s to appear is to move to another record and back again.

What I would like to happen, is when I tick the tickbox, the tab/s would appear.

Does this explain things a bit better?

Thanks
 

isladogs

MVP / VIP
Local time
Today, 01:55
Joined
Jan 14, 2017
Messages
18,221
Not sure how to explain it better.......

So I have a form, within that form I have some tab pagers.

By default 2 of the tabs don't appear. To make them appear you have to tick a tickbox, but the only way I can get the tab/s to appear is to move to another record and back again.

What I would like to happen, is when I tick the tickbox, the tab/s would appear.

Does this explain things a bit better?

Thanks

You explained it perfectly the first time
The fact that you have to move to another record & back indicates that you need to force a save.
That's why I suggested my one line of code which you can add to the tickbox event code. Have you tried it?
 

whybrow23

Registered User.
Local time
Today, 01:55
Joined
May 20, 2011
Messages
38
OK thanks

Yes tired your code and no joy

Private Sub CalibrationNeeded_AfterUpdate()
If IsNull(Me.ITSystem) Then
Me.PC_System_Spec.Visible = False
Else
Me.PC_System_Spec.Visible = (Me.ITSystem = True)
End If

If Me.Dirty Then Me.Dirty = False

End Sub
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:55
Joined
May 7, 2009
Messages
19,242
something like this:
Code:
Private Sub yourTickBoxName_Click()
With Me.yourTablCtrlName
        .Pages(0).Visible = Me.yourTickboxName
        .Pages(1).Visible = Me.yourTickboxName
        '.Pages(.Count-1).Visible=Me.yourTickboxName
End With
End Sub
 

isladogs

MVP / VIP
Local time
Today, 01:55
Joined
Jan 14, 2017
Messages
18,221
Is CalibrationNeeded your checkbox? If so, I'd use the Click event.

If that's the issue, you need to force the save BEFORE making the tab visible

I'd rewrite something like this

Code:
Private Sub CalibrationNeeded_Click()

If Me.Dirty Then Me.Dirty = False

If Nz(Me.ITSystem,"") = "" Then
    Me.PC_System_Spec.Visible = False
Else
    Me.PC_System_Spec.Visible = True
End If
 
End Sub

or try arnel's suggestion
 

whybrow23

Registered User.
Local time
Today, 01:55
Joined
May 20, 2011
Messages
38
something like this:
Code:
Private Sub yourTickBoxName_Click()
With Me.yourTablCtrlName
        .Pages(0).Visible = Me.yourTickboxName
        .Pages(1).Visible = Me.yourTickboxName
        '.Pages(.Count-1).Visible=Me.yourTickboxName
End With
End Sub


I'm getting a Compile error

Method or data member not found

??
 

isladogs

MVP / VIP
Local time
Today, 01:55
Joined
Jan 14, 2017
Messages
18,221
Suggest you post a stripped down copy of your database for someone to look at
 

whybrow23

Registered User.
Local time
Today, 01:55
Joined
May 20, 2011
Messages
38
all sorted I think

added this and it seems to be playing ball

Private Sub ITSystem_Click()
Me.Requery
End Sub

thanks for your help guys.
 

isladogs

MVP / VIP
Local time
Today, 01:55
Joined
Jan 14, 2017
Messages
18,221
Excellent. In fact, I was originally going to suggest using Me.Requery .... :)
 

Users who are viewing this thread

Top Bottom