A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"If" question



 
 
Thread Tools Display Modes
  #1  
Old March 20th, 2008, 02:32 PM posted to microsoft.public.access.forms
margaret
external usenet poster
 
Posts: 177
Default "If" question

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?
  #2  
Old March 20th, 2008, 03:01 PM posted to microsoft.public.access.forms
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default "If" question

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."

"margaret" wrote in message
...
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?



  #3  
Old March 25th, 2008, 08:51 PM posted to microsoft.public.access.forms
margaret
external usenet poster
 
Posts: 177
Default "If" question

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.

"Al Campagna" wrote:

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."

"margaret" wrote in message
...
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?




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:26 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.