By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,787 Members | 2,251 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,787 IT Pros & Developers. It's quick & easy.

how to know the record position shown in a form?

P: n/a
I have a form that shows a table in single form format.
how can I know the position of the record the form is current showing
so that I can enable or disable some buttons according to the position
information.
For example if the form is showing the first record I need to disable
the Previous button, and for the last record I need to disable the Next
button, etc.
Thanks

Dec 14 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hello
Access navigation buttons do it for you. Haven't you noticed that when
you are at the first record, button Go To Previous is disabled? Button
Go To Next is disabled, when you are at the last record, if the form
doesn't allow to add records. If the form does, the button is not
disabled because Go To Next creates a new record in this case. Hope it
helps.
Galka

zh**********@hotmail.com wrote:
I have a form that shows a table in single form format.
how can I know the position of the record the form is current showing
so that I can enable or disable some buttons according to the position
information.
For example if the form is showing the first record I need to disable
the Previous button, and for the last record I need to disable the Next
button, etc.
Thanks


Dec 14 '05 #2

P: n/a
On 13 Dec 2005 20:47:14 -0800, zh**********@hotmail.com wrote:
I have a form that shows a table in single form format.
how can I know the position of the record the form is current showing
so that I can enable or disable some buttons according to the position
information.
For example if the form is showing the first record I need to disable
the Previous button, and for the last record I need to disable the Next
button, etc.
Thanks


If you are replacing the built in navigation buttons with your own
command buttons, you can use, in the Form's Current event:

cmdPreviousButton.Enabled = Not Me.CurrentRecord = 1
cmdNextButton.Enabled = Me.CurrentRecord = 1 Or Me.CurrentRecord <
Me.Recordset.RecordCount

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Dec 14 '05 #3

P: n/a
Thanks Fred. Yes that's what I want.
all the best
If you are replacing the built in navigation buttons with your own
command buttons, you can use, in the Form's Current event:

cmdPreviousButton.Enabled = Not Me.CurrentRecord = 1
cmdNextButton.Enabled = Me.CurrentRecord = 1 Or Me.CurrentRecord <
Me.Recordset.RecordCount

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


Dec 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.