Recall a record from a form to another form

A

Antonio

hello, all....I am trying to call another record from a
form to another form. This is what I have, but when I
double-click on the company name it doesn't show the
record for that customer, but it shows the first record in
the other form. Any help will be appreciated. Thanks

Private Sub CompanyName_DblClick(Cancel As Integer)

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

DoCmd.Close acForm, "OpenTTs"

End Sub
 
D

David Straker

Antonio,
Why not have frmTroubleTicket as a sub-form of whatever form CompanyName is
on (presumably OpenTTs). Maybe on a tab control.

If you must do it by opening a new form, here's an (Access 2000) example
that shows how to open the form with a where condition. Be very careful how
many commas and quotation marks you use and where you put them.
DoCmd.OpenForm "frmTroubleTicket", , ,"[YourTableName].[CompanyName] = " &
"""" & Me.CompanyName & """"David Straker
 

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