Newbie Problem

  • Thread starter Thread starter dave
  • Start date Start date
D

dave

Hi

Any ideas how I can do this? I have a form with a checkbox. By default the
check box is ticked, if you untick the checkbox a tab is made visible. I
have done this by

Private Sub Current_Click()
If Current.Value = True Then
Page80.Visible = False
Else
Page80.Visible = True
End If

This works fine if I tick or untick the box. The problem I have is when I
navigate thru the records. Because the checkbox is not being physically
ticked or unticked, the code doesnt run. How I can I get the code to run
when navigating from one record to the next?

Thanks
 
dave said:
Hi

Any ideas how I can do this? I have a form with a checkbox. By default the
check box is ticked, if you untick the checkbox a tab is made visible. I
have done this by

Private Sub Current_Click()
If Current.Value = True Then
Page80.Visible = False
Else
Page80.Visible = True
End If

This works fine if I tick or untick the box. The problem I have is when I
navigate thru the records. Because the checkbox is not being physically
ticked or unticked, the code doesnt run. How I can I get the code to run
when navigating from one record to the next?

Thanks

Hi.

This is a part of your code:
If Current.Value = True Then
Don't use in any way a reserved Word, Current it's one of this.

I suppose you have a CheckBox Control, may be named "ck1" for samlpe

Usually to ave a good changes Event you need to use OnChange or
AfterUpdate CheckBox Event's.

Me.Page80.Visible=Me.ck1

If your check control is bound to a Field, you can store the value on Table,
so you can also call this on Current Sub Events, if is not Bound you
don't need anythink more that enable the page:

'// This is Click CheckBox event
Private Sub ck1_Click()
Me.Page80.Visible=Me.ck1
End Sub

'// This is Current Form Event
Private Sub Current_Click()
me.ck1=True
call ck1_Click()
End If

Hope this help you
 
Use the Current event of the form.

Private Sub Form_Current()
Call Current_Click
End Sub

(It looks a bit confusing, but the form's Current event has no relation to
your check box named Current.)
 
Err Help!

Ok I have changed the name of the Control from Current to scurrent.

The problem is that when I click on the navigation buttons at the bottom of
the form to navigate to another record, the code will not run. The records
are not being updated, just viewed so "after update" or "on Change" do not
apply.

Any ideas?
 
Err Help!
Ok I have changed the name of the Control from Current to scurrent.

The problem is that when I click on the navigation buttons at the bottom of
the form to navigate to another record, the code will not run. The records
are not being updated, just viewed so "after update" or "on Change" do not
apply.

Any ideas?


I make a mistake with copy/past

If you use this two sub is not possible, you can
insetr a BrakePoint on Current Event to view
the real flow code.

Private Sub Current()
me.ck1=True
call ck1_Click()
End If

'// This is Click CheckBox event
Private Sub ck1_Click()
Me.Page80.Visible=Me.ck1
End Sub


Bye
 
Works wonderfully

Thanks!

Allen Browne said:
Use the Current event of the form.

Private Sub Form_Current()
Call Current_Click
End Sub

(It looks a bit confusing, but the form's Current event has no relation to
your check box named Current.)
 
Back
Top