Full Version: Click On Field Go To Form And Then Highlight Specific Record
UtterAccess Forums > Microsoft® Access > Access Forms
I have a form that shows the history by month for a specific product Id.
When you click on the month, it goes to another form that shows the whole history of all products for that month.
This is done in VBA like this:

DoCmd.OpenForm "F_SalesMix_monthly_detail", , , "month = " & Me!Month

What I would like it to do is open the new form and highlight the product Id that was on the subsequent form so the user has a reference as to where that product ID fell in ranking of returns.

I realize that when I open the new form, the product ID is lost so how do I keep the focus on that product Id and then highlight it? (conditional formatting?)

the first form is called F_SalesMix_monthlybyprod and the field on that form is called product_id

Thank you.
Did you mean to post this in the Excel forum?
I realize that when I open the new form, the product ID is lost

You can use the OpenArgs argument in OpenForm to pass a value to the form being opened. In that form, Me.OpenArgs will produce that value. I expect you could use that value to provide conditional formatting.
thank you I did not realize that smile.gif
how do I delete this post?
I asked the moderators to move the post to an appropriate forum.

Meanwhile, did OpenArgs help?
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.