Opening a form based on a record selected in a list box

So now that I have the list box working correctly I am needing the ability to select a record in the list box, double click it and a form displaying everything associated with the record is displayed.  

I have a unique ID; Hardware_ID and the form I need it to open is frm_Inventory
The name of the list box is HWB_LIST

Thanks
John
John SheehySecurity AnalystAsked:
Who is Participating?
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.

Fabrice LambertFabrice LambertCommented:
Hi,

Use the double click event of your list box:
Private Sub HWB_LIST_DblClick(Cancel As Integer)
    Select Case HWB_LIST.Value
        '// ect ect ...
    End Select
End Sub

Open in new window

0
John SheehySecurity AnalystAuthor Commented:
I don't know how to tell the double click event to open the correct record.  Maybe something like this?

stLinkCriteria = "[Hardware_ID]=" & "'" & Me.HWB_LIST.Hardware_ID & "'"
stDOCName = "frm_Inventory"

        DoCmd.OpenForm stDOCName, , , stLinkCriteria

    End If

John
0
John SheehySecurity AnalystAuthor Commented:
So I figured it out.  The solution is:

stLinkCriteria = "[Hardware_ID]=" & Me.HWB_LIST.Value
stDOCName = "frm_Inventory"

        DoCmd.OpenForm stDOCName, , , stLinkCriteria

John
0

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
John SheehySecurity AnalystAuthor Commented:
I was able to figure out before an expert commented on it
0
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
Databases

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.