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

A1ex037

Registered User.
Local time
Today, 03:56
Joined
Feb 10, 2018
Messages
48
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
Yesterday, 18:56
Joined
Oct 29, 2018
Messages
15,548
Try adding a button to clear the filter. For example:
Code:
Me.Filter=""
Me.FilterOn=False
 

A1ex037

Registered User.
Local time
Today, 03:56
Joined
Feb 10, 2018
Messages
48
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

once i caught a fish alive...
Local time
Today, 09:56
Joined
May 7, 2009
Messages
13,205
see this demo and look at the code of each form/subform.
 

Attachments

  • sales.accdb
    992 KB · Views: 19

A1ex037

Registered User.
Local time
Today, 03:56
Joined
Feb 10, 2018
Messages
48
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