Re: 2 Forms Updating 1 Table

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Angeline (Angeline_at_discussions.microsoft.com)
Date: 12/30/04


Date: Wed, 29 Dec 2004 18:55:01 -0800


Wayne,
Thank you very much for that response. The problem however is that I am
creating a new record each time I update the form, or that is what I hope to
do. Does this mean it is not possible?

"Wayne Morgan" wrote:

> To do this, the record you are "updating" has to already exist. You can't be
> creating a new record. Next, in the DoCmd.OpenForm command there is an
> option to pass a filter.
>
> DoCmd.OpenForm(FormName, View, FilterName, WhereCondition, DataMode,
> WindowMode, OpenArgs)
>
> The WhereCondition argument is the one you are after. Pass the unique ID
> field of the record in this argument.
>
> Example:
> "IDField=" & Me.txtID
> if the value is a string instead of a number
> "IDField='" & Me.txtID & "'"
>
> Another option is to pass this value in the OpenArgs argument, then in the
> Load event of the second form, use this argument to move to the desired
> record. The OpenArgs argument accepts a string value, so you may have to
> pass the value as a string, even if it is a number, then convert it back in
> the second form.
>
> Example:
> Me.Recordset.FindFirst "IDField=" & CLng(Me.OpenArgs)
>
> --
> Wayne Morgan
> MS Access MVP
>
>
> "Angeline" <Angeline@discussions.microsoft.com> wrote in message
> news:18C1116D-1798-4FDB-96A8-66313998DB71@microsoft.com...
> >I am buidling two forms (form1 and form2). They both update the same table
> > but form2 is activated (via a macro) from form1 when a particular field is
> > populated. My problem is that I cannot get form 2 (when activated) to
> > open
> > up at the same record as what is being updated in form1. It defaults back
> > to
> > the first record in the table and I need it to open up at the current
> > record
> > I was updating in form1. I'd really appreciate some help.
>
>
>



Relevant Pages

  • Re: 2 Forms Updating 1 Table
    ... Could you clarify what is the DoCmd.OpenForm. ... View, FilterName, WhereCondition, DataMOde, WindowMode, OpenArgs) to be the ... > Load event of the second form, use this argument to move to the desired ... > Wayne Morgan ...
    (microsoft.public.access.forms)
  • Re: Unpacking OpenArgs
    ... Public Function ParseText(TextIn As String, ... Dim var As Variant ... To pass an OpenArgs when opening the second form: ...
    (microsoft.public.access.formscoding)
  • Re: multiple instances of a form x 2
    ... thanks wayne, i would do that except there is no docmd.openForm command. ... You can them get that string in the opened form ... >> my main form is able to load multiple instances of the second form. ...
    (microsoft.public.access.forms)
  • Re: Use a Variable to set a Variable
    ... ..OpenArgs only takes a string. ... If you're only going to be passing in a single ... you might want to run the report ...
    (microsoft.public.access.modulesdaovba)
  • Re: Use a Variable to set a Variable
    ... Form or Report via the .OpenArgs property - which is a string as opposed to ... This would allow for any number of parameters to be passed to a Form/Report ... Form/Report that takes .OpenArgs so that the assorted parameters show up via ... Sub openFormfrmManifest(Optional strShowDetail as String, ...
    (microsoft.public.access.modulesdaovba)