Return Key Value from Data View

G

Guest

Hi All,

Hopefully this one isn't to simplistic for you all... After 3 days of
working with Access for the first time I can't answer this one on my own...

I have a combobox that filters a subform based on a Product ID... I.e. I
use a Products Combobox to see product names and link to the product ID...
My subform is then filtered... GREAT. The short of it is that It will show
me all Contacts that have experience with the requested Product.

NOW, I want to be able to double click on a single contact to be used as a
reference. I want to double click on the contact to open a new form and pass
the "Key" value (ContactID) to the new window.

First I don't see an event for double click for each record in the dataview.
I do see a DblClick event for the Detail Section of the subform but that
doesn't seem to work for the records as a whole... There is a DblClick event
for each individual attribute i.e. First Name, LastName, etc. but I can't
guarantee that the user will double click on a specific field in data view
AND I don't know how to now pickup the key value from the table...

So can anyone answer any part of the above?

I'm sure this is worded in a very confusing manner.. I hope that one of you
can follow my description.

Thanks
-Rob
 
D

Duane Hookom

I create a function in the subform like:

Function OpenContact()
Dim strWhere as String
strWhere = "ContactID =" & Me.ContactID
DoCmd.OpenForm "frmContact", , , strWhere
End Function

You can then select all the text boxes in the subform detail section and set
all their Double-Click events to
=OpenContact()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top