 | 
18-Nov-2005, 14:00 PM
|  | Guest | | | | | | | | | | How to find if a field exists? Using Access 2003,
I'm trying to create a command button on a form (frmBase) that will open a
popup form (frmPopup) with related data (linked relationship of "ID" and
"ForeignID"). I can get this to work fine, HOWEVER, if there is no data (ie. Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/7685-how-to-find-if-field-exists.html
the ForeignID does not exist) then I want to open the form in DataEntry =
True mode. I know how to open a form in DataEntry mode, but I'm having Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7685
difficulty with the IF/Then.
So, what conditional code do I need to see if a record exists?
TIA
Aaron G
Philadelphia, PA Got anything to share on This Topic? Why not share your immediate thoughts/reaction with us! Login Now! or Sign Up Today! to share your views... Gurfateh! | 
18-Nov-2005, 14:00 PM
|  | Guest | | | | | | | | | | RE: How to find if a field exists? Can you post what you have now?
On the OnClick event I would put something like that
If Isnull(DLookUp("FieldName","TableName","Enter here the criteria") Then
' New record open in add mode
Docmd.OpenForm "FormName",,,,acFormAdd
Else
' Existing recod, open in edit mode with criteria
Docmd.OpenForm "FormName",,,WhereCondition,acFormEdit Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7685
End if
--
I hope that helped
Good Luck
"Aaron G" wrote:
> Using Access 2003,
>
> I'm trying to create a command button on a form (frmBase) that will open a
> popup form (frmPopup) with related data (linked relationship of "ID" and
> "ForeignID"). I can get this to work fine, HOWEVER, if there is no data (ie.
> the ForeignID does not exist) then I want to open the form in DataEntry =
> True mode. I know how to open a form in DataEntry mode, but I'm having
> difficulty with the IF/Then. Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7685
>
> So, what conditional code do I need to see if a record exists?
>
> TIA
>
> Aaron G
> Philadelphia, PA | 
18-Nov-2005, 14:00 PM
|  | Guest | | | | | | | | | | RE: How to find if a field exists? Ofer,
That worked perfectly. I'm to embarrased to show you the mess I was trying Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7685
to make. My blood sugar must be getting low.
As always, thanks for your help.
Aaron G
Philadelphia, PA
"Ofer" wrote:
> Can you post what you have now?
>
> On the OnClick event I would put something like that
> If Isnull(DLookUp("FieldName","TableName","Enter here the criteria") Then
> ' New record open in add mode
> Docmd.OpenForm "FormName",,,,acFormAdd
> Else
> ' Existing recod, open in edit mode with criteria
> Docmd.OpenForm "FormName",,,WhereCondition,acFormEdit
> End if
> --
> I hope that helped
> Good Luck
>
>
> "Aaron G" wrote:
>
> > Using Access 2003,
> >
> > I'm trying to create a command button on a form (frmBase) that will open a Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7685
> > popup form (frmPopup) with related data (linked relationship of "ID" and
> > "ForeignID"). I can get this to work fine, HOWEVER, if there is no data (ie.
> > the ForeignID does not exist) then I want to open the form in DataEntry =
> > True mode. I know how to open a form in DataEntry mode, but I'm having
> > difficulty with the IF/Then.
> >
> > So, what conditional code do I need to see if a record exists?
> >
> > TIA
> >
> > Aaron G
> > Philadelphia, PA | 
18-Nov-2005, 14:00 PM
|  | Guest | | | | | | | | | | RE: How to find if a field exists? Glad I could Help
Good Luck
"Aaron G" wrote:
> Ofer,
>
> That worked perfectly. I'm to embarrased to show you the mess I was trying
> to make. My blood sugar must be getting low.
>
> As always, thanks for your help.
>
> Aaron G
> Philadelphia, PA
>
> "Ofer" wrote:
>
> > Can you post what you have now?
> >
> > On the OnClick event I would put something like that
> > If Isnull(DLookUp("FieldName","TableName","Enter here the criteria") Then
> > ' New record open in add mode
> > Docmd.OpenForm "FormName",,,,acFormAdd
> > Else
> > ' Existing recod, open in edit mode with criteria
> > Docmd.OpenForm "FormName",,,WhereCondition,acFormEdit
> > End if
> > -- Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7685
> > I hope that helped
> > Good Luck
> >
> >
> > "Aaron G" wrote:
> >
> > > Using Access 2003,
> > >
> > > I'm trying to create a command button on a form (frmBase) that will open a
> > > popup form (frmPopup) with related data (linked relationship of "ID" and Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7685
> > > "ForeignID"). I can get this to work fine, HOWEVER, if there is no data (ie.
> > > the ForeignID does not exist) then I want to open the form in DataEntry =
> > > True mode. I know how to open a form in DataEntry mode, but I'm having
> > > difficulty with the IF/Then.
> > >
> > > So, what conditional code do I need to see if a record exists?
> > >
> > > TIA
> > >
> > > Aaron G
> > > Philadelphia, PA | 
Support Us! Become a Promoter! | | Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh! | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Tools | Search | | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is On | | | | » Active Discussions | | | | | | | | | | | | | | | | | | | | | | | | | Amrit Yesterday 09:17 AM 5 Replies, 364 Views | | | | | » Books You Should Read... | | | |