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

Next / Previous Record Buttons

P: n/a
Hi All,

I would like some advice on Next / Previous record buttons.

I have a main form for the client, and a continuous subform listing
client transactions. If I open one of these transactions ( dblclick )
in say 'frmtransaction', I would like to scroll forward and backward
through the transactions as they appear on the continuous subform
without actually having to close 'frmtransaction' and go back to the
subform.

The Next / Previous buttons produced by the wizard work well, but only
move by record number, not by transaction date.

Regards

Karl
Nov 13 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Karl,

Change your subform recordsource to a query based oin your client transactions,
include the transaction date in the query and sort descending. Your records will
be in order of the transaction date and you can use the built-in navigation
buttons to move by transaction date.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"Karl Roes" <ka******@hotmail.com> wrote in message
news:7c**************************@posting.google.c om...
Hi All,

I would like some advice on Next / Previous record buttons.

I have a main form for the client, and a continuous subform listing
client transactions. If I open one of these transactions ( dblclick )
in say 'frmtransaction', I would like to scroll forward and backward
through the transactions as they appear on the continuous subform
without actually having to close 'frmtransaction' and go back to the
subform.

The Next / Previous buttons produced by the wizard work well, but only
move by record number, not by transaction date.

Regards

Karl

Nov 13 '05 #2

P: n/a
Hi,

This suggestion of using the built-in navigations buttons does work
very well when moving within the subform itself.
Enabling the built-in navigation buttons on the form that opens from
this subform doesn't seem to restrict records to only those client
records on the subform from which it opens, it still scrolls through
all transactions for all clients.

Thank you for your time.

Regards

Karl


"PC Datasheet" <no****@nospam.spam> wrote in message news:<_A****************@newsread2.news.atl.earthl ink.net>...
Karl,

Change your subform recordsource to a query based oin your client transactions,
include the transaction date in the query and sort descending. Your records will
be in order of the transaction date and you can use the built-in navigation
buttons to move by transaction date.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"Karl Roes" <ka******@hotmail.com> wrote in message
news:7c**************************@posting.google.c om...
Hi All,

I would like some advice on Next / Previous record buttons.

I have a main form for the client, and a continuous subform listing
client transactions. If I open one of these transactions ( dblclick )
in say 'frmtransaction', I would like to scroll forward and backward
through the transactions as they appear on the continuous subform
without actually having to close 'frmtransaction' and go back to the
subform.

The Next / Previous buttons produced by the wizard work well, but only
move by record number, not by transaction date.

Regards

Karl

Nov 13 '05 #3

P: n/a
Hi,

I think I have worked this out. :-)

I changed the recordset of the detail form ( the one that opens from
the subform ) to the same as the subform from which it opens and set
the ClientID to be the same as the Parent of the subform.
I had the datasource of the detail form reading directly back to the
tables - no wonder all the records were showing up and not just the
ones for the selected client. ;-\

The built-in navigation buttons work a treat and so do the buttons
created by the wizard. I do need these custom buttons on the form to
navigate - they are easier to see, so is there a way of supressing the
' ...end of recordset' msgbox when using these?
Regards

Karl


"PC Datasheet" <no****@nospam.spam> wrote in message news:<_A****************@newsread2.news.atl.earthl ink.net>...
Karl,

Change your subform recordsource to a query based oin your client transactions,
include the transaction date in the query and sort descending. Your records will
be in order of the transaction date and you can use the built-in navigation
buttons to move by transaction date.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"Karl Roes" <ka******@hotmail.com> wrote in message
news:7c**************************@posting.google.c om...
Hi All,

I would like some advice on Next / Previous record buttons.

I have a main form for the client, and a continuous subform listing
client transactions. If I open one of these transactions ( dblclick )
in say 'frmtransaction', I would like to scroll forward and backward
through the transactions as they appear on the continuous subform
without actually having to close 'frmtransaction' and go back to the
subform.

The Next / Previous buttons produced by the wizard work well, but only
move by record number, not by transaction date.

Regards

Karl

Nov 13 '05 #4

P: n/a
Hi,

There I go again. ;-/

That msgbox actually reads " You can't go to the specified record ".

Regards

Karl


"PC Datasheet" <no****@nospam.spam> wrote in message news:<_A****************@newsread2.news.atl.earthl ink.net>...
Karl,

Change your subform recordsource to a query based oin your client transactions,
include the transaction date in the query and sort descending. Your records will
be in order of the transaction date and you can use the built-in navigation
buttons to move by transaction date.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

"Karl Roes" <ka******@hotmail.com> wrote in message
news:7c**************************@posting.google.c om...
Hi All,

I would like some advice on Next / Previous record buttons.

I have a main form for the client, and a continuous subform listing
client transactions. If I open one of these transactions ( dblclick )
in say 'frmtransaction', I would like to scroll forward and backward
through the transactions as they appear on the continuous subform
without actually having to close 'frmtransaction' and go back to the
subform.

The Next / Previous buttons produced by the wizard work well, but only
move by record number, not by transaction date.

Regards

Karl

Nov 13 '05 #5

P: n/a
ka******@hotmail.com (Karl Roes) wrote in message news:<7c**************************@posting.google. com>...
The built-in navigation buttons work a treat and so do the buttons
created by the wizard. I do need these custom buttons on the form to
navigate - they are easier to see, so is there a way of supressing the
' ...end of recordset' msgbox when using these?


When I use custom navigation buttons I like to wrap by going back to
the beginning of the recordset when they go past the end and by going
to the end when they go before the beginning. Of course, they might
get confused by this if you don't show which record of the total
number of records they are on.

James A. Fortune
Nov 13 '05 #6

P: n/a
Handle error 2105 in your error handler for the procedure e.g.

Dim Response As Integer
Select Case Err.number
Case 2105
Response = acDataErrContinue
Case Else
MsgBox Err.number & ": " & Err.Description
End Select

HTH
Nov 13 '05 #7

P: n/a

ka******@hotmail.com (Karl Roes) wrote in message
news:<7c**************************@posting.google. com>...
The built-in navigation buttons work a treat and so do the
buttons created by the wizard. I do need these custom buttons
on the form to navigate - they are easier to see, so is there
a way of supressing the ' ...end of recordset' msgbox when
using these?


Add a guard clause around the code the wizard created:

If (Me.Recordset.AbsolutePosition + 1) _
< Me.Recordset.RecordCount Then
DoCmd.GoToRecord , , acNext
End If

absolute position is 0-based,

Bob Q.
Nov 13 '05 #8

P: n/a
In message <Xn**********************@66.150.105.50>, Bob Quintal
<bq******@generation.net> writes

ka******@hotmail.com (Karl Roes) wrote in message
news:<7c**************************@posting.google .com>...
The built-in navigation buttons work a treat and so do the
buttons created by the wizard. I do need these custom buttons
on the form to navigate - they are easier to see, so is there
a way of supressing the ' ...end of recordset' msgbox when
using these?


Add a guard clause around the code the wizard created:

If (Me.Recordset.AbsolutePosition + 1) _
< Me.Recordset.RecordCount Then
DoCmd.GoToRecord , , acNext
End If

absolute position is 0-based,


You could also try something like this in your error handler:

If Err = 2105 Then
'Do Nowt much
'Beep
Else
MsgBox (Str(Err) & " - " & Err.DESCRIPTION)
End If


--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author. Will work for money.

Nov 13 '05 #9

P: n/a
Bernard Peek <ba*@shrdlu.com> wrote in
news:y0**************@shrdlu.com:
In message <Xn**********************@66.150.105.50>, Bob
Quintal <bq******@generation.net> writes

ka******@hotmail.com (Karl Roes) wrote in message
news:<7c**************************@posting.googl e.com>...
The built-in navigation buttons work a treat and so do the
buttons created by the wizard. I do need these custom
buttons on the form to navigate - they are easier to see, so
is there a way of supressing the ' ...end of recordset'
msgbox when using these?


Add a guard clause around the code the wizard created:

If (Me.Recordset.AbsolutePosition + 1) _
< Me.Recordset.RecordCount Then
DoCmd.GoToRecord , , acNext
End If

absolute position is 0-based,


You could also try something like this in your error handler:

If Err = 2105 Then
'Do Nowt much
'Beep
Else
MsgBox (Str(Err) & " - " & Err.DESCRIPTION)
End If

Yes, but the theorists and gurus here suggest that it is better
to prevent errors than handle them. I'm neither a theorist nor a
guru, but I accept their ideas.

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.