"If" question

  • Thread starter Thread starter margaret
  • Start date Start date
M

margaret

I have a form ... frmExhibitor and from that form I can open frmAccounting
displaying only the data the pertains to the exhibitor selected in
frmExhibitor. However, I would like to have an if that states if there is
data for frmAccounting open to that data, if not then open a new form. How
would I do this?
 
margaret,
The OpenForm method has a "Where" argument.
frmExhibitor should have a key unique identifier, the value of which,
pertains to just that record and no others. Example would be CustID.
So, when opening frmAccounting use the Where argument...
DoCmd.OpenForm "frmAccounting", , , "CustID = Forms!frmExhibitor!CustID"

If there is a record in frmAccounting's table, that has a CustID = to
frmExhibitor CustID, frmAccounting will open on that record.
If not, a New blank frmAccounting record will be displayed...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
Thank you ... I actually went to the macro I had set up for the forms and
used the Where argument there. Thanks for pointing me in the right direction.
 

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

Back
Top