Full Version: Click On Field Go To Form And Then Highlight Specific Record
UtterAccess Forums > Microsoft® Access > Access Forms
lclayton1997
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.
BruceM
Did you mean to post this in the Excel forum?
QUOTE
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.
lclayton1997
thank you I did not realize that smile.gif
how do I delete this post?
BruceM
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.