Recall a record from a form to another form

  • Thread starter Thread starter Antonio
  • Start date Start date
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
 
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
 
Back
Top