Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 6th, 2009, 07:58 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default clicking through from record to record on form

I have a bound form which is used for inserting records and viewing existing records. If I open an existing record I want to be able to click the forward and back buttons at the foot of the form to move from record to record, how can I do this???

I didnt build the form and have limited access from experience. Presently when I open a record I do see:

Record: (back arrow) and (forward arrow)

on the bottom however the back button is grayed out and I am only allowed to clik forward which clears the form and alllows me to enter a new record only.

-----------------updated info:
I have been researching this and am fast coming to the conclusion a bound form can not use the record navigation, or at least this one cant. SHould I be able to???


May I add this to the scenario - When I open the form as if I am entering a new record the navigation works. However if I open an exisitng record it does not. I have even turned off the navigation and using controls created my own. This also works and fails in the same way described.

Any ideas???
-----------------------------


TYIA
__________________
Wind is your friend
Matt

Last edited by mat41; January 6th, 2009 at 10:00 PM..
 
Old January 8th, 2009, 12:56 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

It sounds like the form is being opened in different ways. When you open to an existing record, it sounds as if the form is being opened with only one record in the recordset. It also sounds like when you open the form to add a record, it opens it with all the records, but shows you a new record / blank form.

Can you post the code used to open the form for each case? I think the issue here is not the navigation buttons, but how you are opening the form.

You can add buttons using the button wizard, and one of the wizard parameters is to add navigation buttons as you describe.
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
 
Old January 8th, 2009, 05:47 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

This is the code behind the Event Procedure which is fired after:

a.. a text box asks for an ID number to open an existing record
b.. the open Record button is clicked

Private Sub Command28_Click()
On Error GoTo Err_Command28_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FRM_Support_Call1"

stLinkCriteria = "[Ref]=" & Me![Combo26]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command28_Click:
Exit Sub
Err_Command28_Click:
MsgBox Err.Description
Resume Exit_Command28_Click

End Sub

And this is the code in the same scenario however this is for a new record where the navigation works

a.. Open New Call button is clicked.
b.. As seen in the code below Macro ("MCR_Opn_Frm_Call") is called. It contains three lines:
- Minimize (the active window)
- Open Form is the next one which opens the form 'FRM_Support_Call1'
- now GoToRecord is the third line (the form 'FRM_Support_Call1' is in the Object prperties of goToRecord )
c.. Now the form opens and the navigation works:

Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
Dim stDocName As String
stDocName = "MCR_Opn_Frm_Call"
DoCmd.RunMacro stDocName
Exit_Command8_Click:
Exit Sub
Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click

End Sub

This is really bugging me I have spent several hours trying to figure this out now.

TYIA
__________________
Wind is your friend
Matt

Last edited by mat41; January 8th, 2009 at 05:55 PM..
 
Old January 9th, 2009, 08:26 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

So there are your issues:

The first event opens the form with only one record in it, so you will not be able to use the navigation buttons.

The second event runs a macro, which you did not attache, so I am not sure what is going on there. It probably opens the form and gives you all the records, but moves to a new record first.

You can simply create a button to open the form normally, and all your navigation buttons will work. There is no problem with your code or forms or the nav buttons. Everything is doing what it is supposed to do.

Try this code on a new button:

Dim sDoc As String

sDoc = "FRM_Support_Call1"

DoCmd.OpenForm sDoc

Or use the other form name MCR_Opn_Frm_Call. They are probably copies of the same form, just with different recordsets.

Did that help?
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
passing unique record from form to form Baconant Beginning VB 6 1 January 2nd, 2008 06:20 PM
ListView record in a form osemollie Pro VB Databases 7 May 19th, 2006 04:05 AM
Record locking - user needs the next queued record cbtoolkit SQL Server 2000 0 December 6th, 2004 08:29 AM
Keep last record in a form patmolard Access VBA 17 April 22nd, 2004 01:02 PM
Adding a record using a form cailos Access 2 October 12th, 2003 11:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.