A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Enable navigation buttons



 
 
Thread Tools Display Modes
  #1  
Old May 25th, 2004, 04:15 PM
Bruce
external usenet poster
 
Posts: n/a
Default Enable navigation buttons

This is a partial repost with a different subject line, as
I received no reply to the previous question. Please
excuse the repetition, but I rarely receive a reply if I
do not hear within 24 hours.
I have a form (frmSession) to record a training session,
with fields for subject, instructor, etc. cmdPrevious and
cmdNext are navigation buttons on the form itself (rather
than at the bottom left corner). txtRecordCount is an
unbound text box to show the total number of records. The
form's On Open event includes the following (underscores
indicate no line break):

cmdPrevious.Enabled = Not Me.CurrentRecord = 1
cmdNext.Enabled = (Me.CurrentRecord = 1 And_
Me.Recordset.RecordCount 1) Or Me.CurrentRecord _
Me.Recordset.RecordCount
Me.txtRecordCount = Me.Recordset.RecordCount
Me.RecordSet.AddNew

The first two lines of code enable the navigation buttons
only when there are records. The third line of code is
intended to put the total number of records into
txtRecordCount. The fourth line opens the form at a
new record. The form opens with cmdPrevious enabled, and
cmdNext not enabled, just like with the built-in buttons
at the bottom of the form. txtRecordCount works as
expected.

To filter by [Subject], I select a value from a combo box
(cboLookupSubject) and apply the following to the combo
box's After Update event:
DoCmd.ApplyFilter, "[Subject]='" & cboLookupSubject_
& "'"

The After Update event also includes code similar to the
form's On Open event, but the navigation buttons are not
enabled and txtCounter is incorrect unless the code also
contains DoCmd.GoToRecord , , acLast, or until I move to
another record using the built-in navigation buttons at
the bottom of the form. The built-in navigation buttons
work as expected, as does the record counter. I would
like to have the navigation buttons I added to the form
work in the same way.
The other thing I would like to do with the counter is to
show 1 of 12, 2 of 12, etc. txtCounter shows the total,
but I don't know how to show the current (1, 2, etc.). I
know the built-in counter does this, but I would like it
to be right on the form, near the combo box.

  #2  
Old May 25th, 2004, 04:45 PM
John Milward
external usenet poster
 
Posts: n/a
Default Enable navigation buttons

Bruce

I think this covers everthing you need
http://www.applecore99.com/frm/frm014.asp
I have used this and it seems fine

regards

John

"Bruce" wrote in message
...
This is a partial repost with a different subject line, as
I received no reply to the previous question. Please
excuse the repetition, but I rarely receive a reply if I
do not hear within 24 hours.
I have a form (frmSession) to record a training session,
with fields for subject, instructor, etc. cmdPrevious and
cmdNext are navigation buttons on the form itself (rather
than at the bottom left corner). txtRecordCount is an
unbound text box to show the total number of records. The
form's On Open event includes the following (underscores
indicate no line break):

cmdPrevious.Enabled = Not Me.CurrentRecord = 1
cmdNext.Enabled = (Me.CurrentRecord = 1 And_
Me.Recordset.RecordCount 1) Or Me.CurrentRecord _
Me.Recordset.RecordCount
Me.txtRecordCount = Me.Recordset.RecordCount
Me.RecordSet.AddNew

The first two lines of code enable the navigation buttons
only when there are records. The third line of code is
intended to put the total number of records into
txtRecordCount. The fourth line opens the form at a
new record. The form opens with cmdPrevious enabled, and
cmdNext not enabled, just like with the built-in buttons
at the bottom of the form. txtRecordCount works as
expected.

To filter by [Subject], I select a value from a combo box
(cboLookupSubject) and apply the following to the combo
box's After Update event:
DoCmd.ApplyFilter, "[Subject]='" & cboLookupSubject_
& "'"

The After Update event also includes code similar to the
form's On Open event, but the navigation buttons are not
enabled and txtCounter is incorrect unless the code also
contains DoCmd.GoToRecord , , acLast, or until I move to
another record using the built-in navigation buttons at
the bottom of the form. The built-in navigation buttons
work as expected, as does the record counter. I would
like to have the navigation buttons I added to the form
work in the same way.
The other thing I would like to do with the counter is to
show 1 of 12, 2 of 12, etc. txtCounter shows the total,
but I don't know how to show the current (1, 2, etc.). I
know the built-in counter does this, but I would like it
to be right on the form, near the combo box.



  #3  
Old May 25th, 2004, 05:07 PM
Bruce
external usenet poster
 
Posts: n/a
Default Enable navigation buttons

Do you mean to tell me that it was that simple all along?
Thanks for the speedy reply, and for the very helpful link.

-----Original Message-----
Bruce

I think this covers everthing you need
http://www.applecore99.com/frm/frm014.asp
I have used this and it seems fine

regards

John

"Bruce" wrote in

message
...
This is a partial repost with a different subject line,

as
I received no reply to the previous question. Please
excuse the repetition, but I rarely receive a reply if I
do not hear within 24 hours.
I have a form (frmSession) to record a training session,
with fields for subject, instructor, etc. cmdPrevious

and
cmdNext are navigation buttons on the form itself

(rather
than at the bottom left corner). txtRecordCount is an
unbound text box to show the total number of records.

The
form's On Open event includes the following (underscores
indicate no line break):

cmdPrevious.Enabled = Not Me.CurrentRecord = 1
cmdNext.Enabled = (Me.CurrentRecord = 1 And_
Me.Recordset.RecordCount 1) Or Me.CurrentRecord

_
Me.Recordset.RecordCount
Me.txtRecordCount = Me.Recordset.RecordCount
Me.RecordSet.AddNew

The first two lines of code enable the navigation

buttons
only when there are records. The third line of code is
intended to put the total number of records into
txtRecordCount. The fourth line opens the form at a
new record. The form opens with cmdPrevious enabled,

and
cmdNext not enabled, just like with the built-in buttons
at the bottom of the form. txtRecordCount works as
expected.

To filter by [Subject], I select a value from a combo

box
(cboLookupSubject) and apply the following to the combo
box's After Update event:
DoCmd.ApplyFilter, "[Subject]='" & cboLookupSubject_
& "'"

The After Update event also includes code similar to the
form's On Open event, but the navigation buttons are not
enabled and txtCounter is incorrect unless the code also
contains DoCmd.GoToRecord , , acLast, or until I move to
another record using the built-in navigation buttons at
the bottom of the form. The built-in navigation buttons
work as expected, as does the record counter. I would
like to have the navigation buttons I added to the form
work in the same way.
The other thing I would like to do with the counter is

to
show 1 of 12, 2 of 12, etc. txtCounter shows the total,
but I don't know how to show the current (1, 2, etc.).

I
know the built-in counter does this, but I would like it
to be right on the form, near the combo box.



.

  #4  
Old May 25th, 2004, 05:18 PM
Fred Boer
external usenet poster
 
Posts: n/a
Default Enable navigation buttons

Dear Bruce:

You might also want to take a look the following:

http://www.lebans.com/recnavbuttons.htm

HTH
Fred Boer


"Bruce" wrote in message
...
Do you mean to tell me that it was that simple all along?
Thanks for the speedy reply, and for the very helpful link.

-----Original Message-----
Bruce

I think this covers everthing you need
http://www.applecore99.com/frm/frm014.asp
I have used this and it seems fine

regards

John

"Bruce" wrote in

message
...
This is a partial repost with a different subject line,

as
I received no reply to the previous question. Please
excuse the repetition, but I rarely receive a reply if I
do not hear within 24 hours.
I have a form (frmSession) to record a training session,
with fields for subject, instructor, etc. cmdPrevious

and
cmdNext are navigation buttons on the form itself

(rather
than at the bottom left corner). txtRecordCount is an
unbound text box to show the total number of records.

The
form's On Open event includes the following (underscores
indicate no line break):

cmdPrevious.Enabled = Not Me.CurrentRecord = 1
cmdNext.Enabled = (Me.CurrentRecord = 1 And_
Me.Recordset.RecordCount 1) Or Me.CurrentRecord

_
Me.Recordset.RecordCount
Me.txtRecordCount = Me.Recordset.RecordCount
Me.RecordSet.AddNew

The first two lines of code enable the navigation

buttons
only when there are records. The third line of code is
intended to put the total number of records into
txtRecordCount. The fourth line opens the form at a
new record. The form opens with cmdPrevious enabled,

and
cmdNext not enabled, just like with the built-in buttons
at the bottom of the form. txtRecordCount works as
expected.

To filter by [Subject], I select a value from a combo

box
(cboLookupSubject) and apply the following to the combo
box's After Update event:
DoCmd.ApplyFilter, "[Subject]='" & cboLookupSubject_
& "'"

The After Update event also includes code similar to the
form's On Open event, but the navigation buttons are not
enabled and txtCounter is incorrect unless the code also
contains DoCmd.GoToRecord , , acLast, or until I move to
another record using the built-in navigation buttons at
the bottom of the form. The built-in navigation buttons
work as expected, as does the record counter. I would
like to have the navigation buttons I added to the form
work in the same way.
The other thing I would like to do with the counter is

to
show 1 of 12, 2 of 12, etc. txtCounter shows the total,
but I don't know how to show the current (1, 2, etc.).

I
know the built-in counter does this, but I would like it
to be right on the form, near the combo box.



.



  #5  
Old May 26th, 2004, 06:17 PM
Bruce
external usenet poster
 
Posts: n/a
Default Enable navigation buttons

Thanks for the tip. I have been to Lebans' site before,
but I didn't notice that. I should check there and the
MVP site first when I have questions. I am intrigued by
the idea of using a subform for that purpose, though I
have to admit it is a bit difficult for me to follow,
particularly how the total number of records evidently
appears in a label.
-----Original Message-----
Dear Bruce:

You might also want to take a look the following:

http://www.lebans.com/recnavbuttons.htm

HTH
Fred Boer


"Bruce" wrote in

message
...
Do you mean to tell me that it was that simple all

along?
Thanks for the speedy reply, and for the very helpful

link.

-----Original Message-----
Bruce

I think this covers everthing you need
http://www.applecore99.com/frm/frm014.asp
I have used this and it seems fine

regards

John

"Bruce" wrote in

message
...
This is a partial repost with a different subject

line,
as
I received no reply to the previous question. Please
excuse the repetition, but I rarely receive a reply

if I
do not hear within 24 hours.
I have a form (frmSession) to record a training

session,
with fields for subject, instructor, etc.

cmdPrevious
and
cmdNext are navigation buttons on the form itself

(rather
than at the bottom left corner). txtRecordCount is

an
unbound text box to show the total number of records.

The
form's On Open event includes the following

(underscores
indicate no line break):

cmdPrevious.Enabled = Not Me.CurrentRecord = 1
cmdNext.Enabled = (Me.CurrentRecord = 1 And_
Me.Recordset.RecordCount 1) Or

Me.CurrentRecord
_
Me.Recordset.RecordCount
Me.txtRecordCount = Me.Recordset.RecordCount
Me.RecordSet.AddNew

The first two lines of code enable the navigation

buttons
only when there are records. The third line of code

is
intended to put the total number of records into
txtRecordCount. The fourth line opens the form at a
new record. The form opens with cmdPrevious enabled,

and
cmdNext not enabled, just like with the built-in

buttons
at the bottom of the form. txtRecordCount works as
expected.

To filter by [Subject], I select a value from a combo

box
(cboLookupSubject) and apply the following to the

combo
box's After Update event:
DoCmd.ApplyFilter, "[Subject]='" & cboLookupSubject_
& "'"

The After Update event also includes code similar to

the
form's On Open event, but the navigation buttons are

not
enabled and txtCounter is incorrect unless the code

also
contains DoCmd.GoToRecord , , acLast, or until I

move to
another record using the built-in navigation buttons

at
the bottom of the form. The built-in navigation

buttons
work as expected, as does the record counter. I

would
like to have the navigation buttons I added to the

form
work in the same way.
The other thing I would like to do with the counter

is
to
show 1 of 12, 2 of 12, etc. txtCounter shows the

total,
but I don't know how to show the current (1, 2,

etc.).
I
know the built-in counter does this, but I would

like it
to be right on the form, near the combo box.



.



.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.