DoCmd.BrowseTo specific record in a form (1 Viewer)

A1ex037

Registered User.
Local time
Today, 08:57
Joined
Feb 10, 2018
Messages
50
Hello all,
I have a form that displays results of a query based on SaleID. If I try onClick event (on that ID), it will go correctly to that\record, but I'm unable to move back and forth from that record. It is displayed as "filtered" at the bottom bar. Is there a way to use DoCmd.BrowseTo so that I'd be able to move (once changes are done) back and forth without leaving the form (frmSales in my example). Does it have anything to do with DataMode?

Code:
Private Sub SaleID_Click()
DoCmd.BrowseTo ObjectType:=acBrowseToForm, _
ObjectName:="frmSales", _
PathToSubformControl:="frmNavigation.frmNavSub", _
WhereCondition:="[ID] = " & Me!SaleID ', _
End Sub
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:57
Joined
Oct 29, 2018
Messages
21,364
Try adding a button to clear the filter. For example:
Code:
Me.Filter=""
Me.FilterOn=False
 

A1ex037

Registered User.
Local time
Today, 08:57
Joined
Feb 10, 2018
Messages
50
I did that, just to enable back/ffwd movement in frmSales. What I'm looking is basically "CTRL+F" from current form to be performed on ID field in frmSales.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:57
Joined
May 7, 2009
Messages
19,178
see this demo and look at the code of each form/subform.
 

Attachments

  • sales.accdb
    992 KB · Views: 264

A1ex037

Registered User.
Local time
Today, 08:57
Joined
Feb 10, 2018
Messages
50
Nice, looks like this one is working. Many thanks for constructing this. I will look into it today and apply to my case.
 

Users who are viewing this thread

Top Bottom