Using a string from one form to open another form at the same record

  • Thread starter Thread starter mbentler
  • Start date Start date
M

mbentler

I have a form I use for updating my insurance policy. I have another
form from which I manage my contacts. When I have to update the
insurance policy of ie: ABC Company, I would like the update form to
open at ABC Company and not the first record in the CompanyList table.
Any suggestions?
 
I have a form I use for updating my insurance policy. I have another
form from which I manage my contacts. When I have to update the
insurance policy of ie: ABC Company, I would like the update form to
open at ABC Company and not the first record in the CompanyList table.
Any suggestions?

One of the arguments of OpenForm is WhereCondition, which is the Where
clause to filter for the records you want to see, but without the
"WHERE" keyword. if this is the code behind your button to open your
Contacts form...

DoCmd.OpenForm "frmContacts", acNormal, , "[ContactID]=" &
Me.Controls("cboContactAtCompany"), acFormEdit, acWindowNormal

cboContactAtCompany is a combobox on the open form that the button is
on.
 
Back
Top