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

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?
 
P

pietlinden

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.
 

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