altering form's record navigating properties

T

Ted

when i click this cmd button on my form, i'd like it to disable the user's
ability to use the a2k record navigating buttons along the bottom, you know
the ones i mean, the ones that point to the left and to right. is this a
property that can be controlled at this level? i'd also like to be able to
restore that property at another part of my vba code.

-ted
 
D

Dirk Goldgar

Ted said:
when i click this cmd button on my form, i'd like it to disable the
user's ability to use the a2k record navigating buttons along the
bottom, you know the ones i mean, the ones that point to the left and
to right. is this a property that can be controlled at this level?
i'd also like to be able to restore that property at another part of
my vba code.

You can hid or show the form's built-in navigation buttons by setting
the value of the form's NavigationButtons property to False or True:

Me.NavigationButtons = False ' hide the buttons

Me.NavigationButtons = True ' show the buttons

That won't prevent the user from using other methods of navigating from
record to record, though.
 
T

Ted

hey dirk, it's me again :)

now that we managed to lick the thorny incremental issue on subform
'DaysView', i returned to this thread wherein i added the reference to the
Me.NavigationButtons in the code below. once i do, and test it, what i find
is that if i'm on say the third mainform record, apply the filter, then
remove the filter, that it takes me to the first record's mainform page.
something a little like this was happening in the other thread because a
Me.Requery was not written to accomodate the fact that the subform DaysView
needed to be requeried -- once it was, that seemed to calm things down a bit,
but i don't see any requerying going on in this instance.

-ted



Private Sub FilterDates_Click()
On Error GoTo Err_FilterDates_Click

With Me.[DaysView].Form
If .FilterOn Then
.FilterOn = False 'Turn the filter off.
lngGreen = RGB(0, 150, 0)
Me.FilterDates.ForeColor = lngGreen
Else
.Filter = "[DateOfVisit] >= Date()"
.FilterOn = True
lngRed = RGB(225, 0, 0)
Me.FilterDates.ForeColor = lngRed
End If
End With

If Me.FilterDates.ForeColor = lngRed Then
Me.FilterLbl.Visible = True
Me.Close.Visible = False
Me.Add_Record.Visible = False
Me.NavigationButtons = False
Else
Me.FilterLbl.Visible = False
Me.Close.Visible = True
Me.Add_Record.Visible = True
Me.NavigationButtons = True
End If

Exit_FilterDates_Click:
Exit Sub

Err_FilterDates_Click:
MsgBox Err.description
Resume Exit_FilterDates_Click

End Sub
 
D

Dirk Goldgar

Ted said:
hey dirk, it's me again :)

now that we managed to lick the thorny incremental issue on subform
'DaysView', i returned to this thread wherein i added the reference
to the Me.NavigationButtons in the code below. once i do, and test
it, what i find is that if i'm on say the third mainform record,
apply the filter, then remove the filter, that it takes me to the
first record's mainform page. something a little like this was
happening in the other thread because a Me.Requery was not written to
accomodate the fact that the subform DaysView needed to be requeried
-- once it was, that seemed to calm things down a bit, but i don't
see any requerying going on in this instance.

-ted



Private Sub FilterDates_Click()
On Error GoTo Err_FilterDates_Click

With Me.[DaysView].Form
If .FilterOn Then
.FilterOn = False 'Turn the filter off.
lngGreen = RGB(0, 150, 0)
Me.FilterDates.ForeColor = lngGreen
Else
.Filter = "[DateOfVisit] >= Date()"
.FilterOn = True
lngRed = RGB(225, 0, 0)
Me.FilterDates.ForeColor = lngRed
End If
End With

If Me.FilterDates.ForeColor = lngRed Then
Me.FilterLbl.Visible = True
Me.Close.Visible = False
Me.Add_Record.Visible = False
Me.NavigationButtons = False
Else
Me.FilterLbl.Visible = False
Me.Close.Visible = True
Me.Add_Record.Visible = True
Me.NavigationButtons = True
End If

Exit_FilterDates_Click:
Exit Sub

Err_FilterDates_Click:
MsgBox Err.description
Resume Exit_FilterDates_Click

End Sub

You should have posted this question to a brand new thread, Ted. It's
completely unrelated to the subject and content of the thread to which
you've posted it.

I'm not sure exactly what problem you're describing. Of course, any
time you apply or remove a filter, the form or subform you're applying
it to is effectively requeried, and resets the current record to the
first record in the requeried recordset. I don't know whether you are
talking about filtering the subform or the main form, and I'm not sure
from your description whether it's the main form or the subform that
you'd like to see remain on the same record, but isn't.
 
T

Ted

okay, dirk. i'm initiating another thread. i apologize for failing to see
that -- it seemed to me an extention at the time.

-ted

Dirk Goldgar said:
Ted said:
hey dirk, it's me again :)

now that we managed to lick the thorny incremental issue on subform
'DaysView', i returned to this thread wherein i added the reference
to the Me.NavigationButtons in the code below. once i do, and test
it, what i find is that if i'm on say the third mainform record,
apply the filter, then remove the filter, that it takes me to the
first record's mainform page. something a little like this was
happening in the other thread because a Me.Requery was not written to
accomodate the fact that the subform DaysView needed to be requeried
-- once it was, that seemed to calm things down a bit, but i don't
see any requerying going on in this instance.

-ted



Private Sub FilterDates_Click()
On Error GoTo Err_FilterDates_Click

With Me.[DaysView].Form
If .FilterOn Then
.FilterOn = False 'Turn the filter off.
lngGreen = RGB(0, 150, 0)
Me.FilterDates.ForeColor = lngGreen
Else
.Filter = "[DateOfVisit] >= Date()"
.FilterOn = True
lngRed = RGB(225, 0, 0)
Me.FilterDates.ForeColor = lngRed
End If
End With

If Me.FilterDates.ForeColor = lngRed Then
Me.FilterLbl.Visible = True
Me.Close.Visible = False
Me.Add_Record.Visible = False
Me.NavigationButtons = False
Else
Me.FilterLbl.Visible = False
Me.Close.Visible = True
Me.Add_Record.Visible = True
Me.NavigationButtons = True
End If

Exit_FilterDates_Click:
Exit Sub

Err_FilterDates_Click:
MsgBox Err.description
Resume Exit_FilterDates_Click

End Sub

You should have posted this question to a brand new thread, Ted. It's
completely unrelated to the subject and content of the thread to which
you've posted it.

I'm not sure exactly what problem you're describing. Of course, any
time you apply or remove a filter, the form or subform you're applying
it to is effectively requeried, and resets the current record to the
first record in the requeried recordset. I don't know whether you are
talking about filtering the subform or the main form, and I'm not sure
from your description whether it's the main form or the subform that
you'd like to see remain on the same record, but isn't.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Top