Calling records from subform

A

Antonio

Hello, all...this is driving me insane!!!
I have a form, which contains a subform with a list of
unresolved issues (only the company name, contact, and
phone). What I am trying to do is this: when a user
double-clicks on the companyname field, the Trouble
Tickets form opens and displays that customer's record.
What it's happening is that it opens the Trouble Tickets
form, but it displays the first record, not the one I
double-click on. Hope this is clear...here is the code
for the subform's control:

Private Sub CompanyName_DblClick(Cancel As Integer)

DoCmd.OpenForm "frmTroubleTicket", , _
wherecondition:="CompanyName = """ & Me!CompanyName
& """"

DoCmd.Close acForm, "OpenTTs"
end sub
 

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