Find a record in a subfrom on a tab control page

Hi

I have a form with a tab control page. On one of the tab control pages, there is a summary form that summarises orders waiting to be booked. This is a continuous form. When a user double clicks on a certain record I would like it to go to another tab control page (that is set to visible = false) and go to the corresponding record that will give them the order details. The ID is TransID.

Have tried various options but not having much luck.

Thanks in advance

Ajae
LVL 2
ajaeclarkeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Does the "other" tab control page have a subform? If so, and assuming you're already on a subform in the first tab, then you'd do something like this:

Dim rst As DAO.Recordset
Set rst = Me.Parent.YourOtherSubform.Form.Recordsetclone

rst.FindFirst "TransID=" & Me.TransID
If Not rst.NoMatch Then
  Me.Parent.YourOtherSubform.Form.Bookmark = rst.Bookmark
End If

Obviously you'd have to change the names to match your Forms/Subforms/Controls. Remember too that the "YourOtherSubform" is the name of the Subform CONTROL, which may or may not be the same as the Form you're using as the SourceObject of that cotnrol.

You'd still have to make that other tab page visible, but I assume you know how to do that.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PatHartmanCommented:
I don't like having forms bound to tables/queries without selection criteria.  It is an especially important concept if your data is in something other than Jet/ACE tables.

I would also not do this with a hidden tab.  I would use a popup form.  Use the DoCmd.OpenForm method and pass the ID as the where argument.  That will be the only line of code you will need.
ajaeclarkeAuthor Commented:
Awesome!! Thank you so much Scott McDaniel....work's a treat :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.