Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View record on Subform, of Popup's Current Record

Status
Not open for further replies.

boxboxbox

Technical User
Apr 22, 2003
108
US
I have a continuous subform that, when a record is double clicked, it pops up another form, which is essentially a more detailed record of what I double-clicked.

On the pop-up, I have a button that will let me go to the next record (which matches the next record on the subform).

Is there a way for this record to be highlighted on the subform, and have this highlighting go to the next record, when I click the Next Record button on the Popup form?

Basically I'd like to be able to see where I am in the Subform list, while having the focus remain on the Popup, where I can view details.

Thanks all!
 
I noticed that after I got to browsing further into the forum!

Sorry about that....

Judge Hopkins

"...like hunting skunks underwater...."
John Steinbeck, The Grapes of Wrath
 
No problem! I meant to emphasize the "is", to imply that since they were both problems I had...it would definitely help to get one solved!

Best...
 
So here is my code for the NextRecord button on the popup:

>>>>
Dim stDocName As String
Dim stLinkCriteria As String


stDocName = "testforjpgs"

stLinkCriteria = "[id]=" & Me![ID] + 1
DoCmd.openform stDocName, , , stLinkCriteria

>>
What, if anything, can I add to it to add the "+1" to the main form first, (so the record selector moves with it to the current record) instead of having the "+1" only on the form?

I tried having it run a GoToControl macro and then reset the focus on the popup, but I get an error saying "Object Required"--I'm not sure of syntax and extra lines for having multiple commands in a piece of code.
 
Okay, so instead of that code, I put:


DoCmd.Close
DoCmd.openform "mainhbform"
DoCmd.GoToControl "testforjpgs"
DoCmd.GoToRecord , , acNext, 1

This at least makes the main form go to the next record. But now I can't get the code (to open a form at the current record) to work, because it says "the object is closed or doesn't exist"

Ie--the code that makes it not work, immediately following the above code:
Dim stdocname As String
Dim stLinkCriteria As String

stdocname = "testforjpgs"

stLinkCriteria = "[id]=" & Me![ID]
DoCmd.openform stdocname, , , stLinkCriteria
Exit_nextrecord_Click:
Exit Sub

Please be something easy...It's almost worse to be this close
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top