The VBA code that you'd run would be this (assuming that it's being run in
the main form or the subform, and that the name of the new form that is to
be opened is not the same as the form in which you are running this code):
DoCmd.OpenForm "NameOfSecondFormBeingOpened", , , _
"[Applicant ID]=" & Me.[Applicant ID].Value, acFormAdd
If you're wanting to use a macro to open this second form, the arguments
would be
Form Name: NameOfSecondFormBeingOpened
View: Form
Filter Name: < empty >
Where Condition: ="[Applicant ID]=" & [Applicant ID]
Data Mode: Add
Window Mode: Normal
If what you seek to do is to open a second copy of the same form in which
you're already working, the above code will not work. You'd need to use a
Form object to do that, but I doubt, based on your description, that that
is
what you need to do here.
--
Ken Snell
<MS ACCESS MVP>
"Darlene" <Darlene@[EMAIL PROTECTED]
> wrote in message
news:CB9D8BCE-20CE-4B39-8FDA-EC3926E6ADE8@[EMAIL PROTECTED]
> Let's try this a different way.
>
> I have a main form with a number of fields including Applicant ID.
After
> this form is completed I want to move to a second form for the same
> Applicant
> ID and complete some additional fields.
>
> What is the correct way to complete this?
>
> "Ken Snell (MVP)" wrote:
>
>> From your description, it appears that the Accident subform is part of
>> the
>> Applicants main form, which is the form that is already open when you
>> click
>> the button. Therefore, the Accident subform should already be visible
in
>> that form? Why do you want to open the subform again as a separate
form?
>>
>> Your current form should show the Accidents data based on the current
>> ApplicantID value in the main form, if the subform has been "connected"
>> to
>> the main form -- though perhaps the wizard didn't do this. Open the
main
>> form in design view, click on the top edge of the subform control, open
>> the
>> Properties window, click on the Data tab, and look to see if Applicant
ID
>> (this actual words Appllicant ID) is in the LinkChildFields and
>> LinkMasterFields properties. If this is not there in both properties,
>> type
>> it into both properties so that the subform is "linked" to the main
form.
>> --
>>
>> Ken Snell
>> <MS ACCESS MVP>
>>
>>
>>
>> "Darlene" <Darlene@[EMAIL PROTECTED]
> wrote in message
>> news:645D11AC-6E59-4E21-B378-0BF9636728FA@[EMAIL PROTECTED]
>> > I'm doing an OpenForm with the following Arguments - Applicants,
Form,
>> > ,
>> > [Applicants]![Applicant ID]=[Accidents]![Applicant ID], Add, Normal
>> >
>> > I created a Form using the wizard and included fields from Applicants
>> > and
>> > Accidents Table and the wizard created an Applicants form and a
>> > Accidents
>> > Subform.
>> >
>> > I hope this additional information helps me get a solution.
>> >
>> > "Ken Snell (MVP)" wrote:
>> >
>> >> What code or macro actions are you running when you click the button
>> >> to
>> >> open
>> >> the Accidents form? You say that the Accident form is a subform, so
>> >> does
>> >> that mean that it's a subform in another main form? and are you
>> >> opening
>> >> that
>> >> other main form too?
>> >>
>> >> Your description needs more details so that we can offer suggestions
>> >> for
>> >> how
>> >> to fix your issue.
>> >>
>> >> --
>> >>
>> >> Ken Snell
>> >> <MS ACCESS MVP>
>> >>
>> >>
>> >> "Darlene" <Darlene@[EMAIL PROTECTED]
> wrote in message
>> >> news:1A0DEB64-4B3B-48D5-917C-E55819B4E6B1@[EMAIL PROTECTED]
>> >> >I have a Main Form which loads the Application Table then I have a
>> >> >button
>> >> > that opens the Accidents Form. The Accident Form is a Subform, I
>> >> > want
>> >> > the
>> >> > Applicant ID from the Main Form to display and then be able to
load
>> >> > the
>> >> > Accidents Table. When I press the button I get a blank form. I
>> >> > don't
>> >> > think
>> >> > I have my settings right.
>> >> > Any help would be appreciated.
>> >>
>> >>
>> >>
>>
>>
>>


|