Re: Open sub forms with linked record if it exists, otherwise a new record

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Marshall Barton (marshbarton_at_wowway.com)
Date: 10/04/04


Date: Mon, 04 Oct 2004 12:37:23 -0500


>> aeilie wrote:
>> >I have a main form with several sub forms as pop ups. Each is linked
>> >to a seperate table, all of which are linked by ID.
>> >
>> >I would like the subforms to open on the relevant record, if it
>> >exists, but otherwise as a new record (recording the ID from the main
>> >form).
>>
>>
>Marshall Barton wrote
>> The Link Master/Child properties are normally used for this.
>> Have you tried using them? if you did, what went wrong?
>
aeilie wrote:
>Thanks for your suggestion. The problem is I need these forms to be
>pop-up forms. I have created them as standard forms, for data entry,
>opened either by a command button or from the 'onClick' event of a
>check box on the main form.
>
>There is no space for subforms to be embedded on the main form. The
>main form contains information users will reference while filling the
>'sub' forms.
>
>I guess I might be missing something elementary here. My only
>solution so far has been to pass IDs between forms for synchronising
>them and I havn't been able to come up with a method for opening the
>form on a new record if no linked record exists.

How about opening the related forms to just the related
records, instead of positioning the form to the record(s) of
interest? This is easy to do by using the OpenForm method's
WhereCondition argument.

As long as the related forms are not restricted to just
editing existing records, the new record area will always be
there, so, if there are no existing related records, the new
record area will be the only thing displayed.

Maybe I'm missing the point of your problem because I just
don't see anything tricky here??

-- 
Marsh
MVP [MS Access]


Relevant Pages

  • Re: Open sub forms with linked record if it exists, otherwise a new record
    ... > aeilie wrote: ... >>I guess I might be missing something elementary here. ... >>them and I havn't been able to come up with a method for opening the ... > record area will be the only thing displayed. ...
    (microsoft.public.access.formscoding)
  • Re: question about forked processes writing to the same file
    ... >> still, i have the code written in such a way that i'm opening, locking, ... it is hard to believe that opening and closing a file ... # process missing files ...
    (comp.lang.perl.misc)
  • Re: AQ opening
    ... I thought) morning 9am server time and I decided that it ... and the opening was scheduled at 7pm. ... schedule without informing anybody, and went to bed. ... so it kind of makes up for missing the opening! ...
    (alt.games.warcraft)
  • Office 2000 Setup
    ... When I start any of the Office programs it quits ... almost immediately after opening with the following error ... "Required registry information is missing and ...
    (microsoft.public.office.setup)