Selasa, 30 Agustus 2011

[MS_AccessPros] Re: should be simple but i can't see it. Update record of bound form, from a popup

 

Crystal, I got it.

I did not want any instanmce wher there were 2 forms open that updated a table, so that was red flag to me.

What I ended up doing was using the popup to change the value on the bound form, then had the popup refresh the bound form.

TY
terence

--- In MS_Access_Professionals@yahoogroups.com, "Terence" <buffalome90210@...> wrote:
>
> Hi, Crystal, TY
> FYI, thanx to You and John, and Duane, I did eventually decide to restructure the DB I was working on. I greatlt reduced the number of tables and overall size. It has created a sequence of NEW problems, which I kind of anticipated, and was another reason I was reluctant.
>
> Now, back to the current problem
>
> it seems no matter what I do I end up with a Write Conflict (that write conflict box, that asks if you want to save, clipbopard, etc).
>
> I understand why I am getting the error, its because I have updated the table from a popup. An the other form is Bound to that table. Hence, the write error.
>
> I cannot see a way around it.
>
> In a simple example.
>
> Table Tbl_A has Field_1, Field_2
>
> This table is bound to an open form , we will call it Frm_tbl_A
>
> from that bound form a user prese a button which opens up POPUP_FORM
>
> POPUP_FORM has the ability to (and needs to) update Tbl_A
>
> This causes the conflict.
>
> As I understand it the refresh would make the bound form current with the current record/table, how ever, that cant happen until the write conflict is resolved.
>
> Terence
>
> --- In MS_Access_Professionals@yahoogroups.com, Crystal <strive4peace2008@> wrote:
> >
> > oops! didn't mean to send this yet...
> >
> > in the Unload event of F_POP1:
> >
> > if you want to save a value on another form that has changed:
> > '~~~~~~~~~~~~~~~~~~~~~~~~
> > If CurrentProject.AllForms("F_MAIN").IsLoaded Then
> > with forms!F_MAIN
> > if .dirty = true then .dirty = false
> > end with
> > End If
> > '~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > if what you mean is that you want the other form to pick up values that may have changed ... use the Close event of the popup:
> >
> > '~~~~~~~~~~~~~~~~~~~~~~~~
> > If CurrentProject.AllForms("F_MAIN").IsLoaded Then
> > currentdb.tabledefs.refresh
> > DoEvents
> > forms!F_MAIN.refresh
> > End If
> > '~~~~~~~~~~~~~~~~~~~~~~~~
> >
> >
> > Warm Regards,
> > Crystal
> >
> > *
> > (: have an awesome day :)
> > *
> >
> > --- On Tue, 8/30/11, Crystal <strive4peace> wrote:
> >
> >
> > > Hi Terence,
> > >
> > > in the Unload event of F_POP1: F_MAIN
> > >
> > >    If
> > > CurrentProject.AllForms("F_MAIN").IsLoaded Then
> > >
> > >       If Forms(pFormname).CurrentView
> > > <> 0 Then IsLoaded = True
> > >    End If
> > >
> > > --- On Tue, 8/30/11, Terence  wrote:
> > >
> > >
> > > > I just cant see the solution,
> > > >
> > > > I have a bound form "F_MAIN"). A button on the bound
> > > form
> > > > opens a popup form (unbound, "F_POP1"). In some
> > > instances
> > > > that popup alters a value on the bound form.
> > > >
> > > > When that happens, I want the BOUND form to refresh
> > > it's
> > > > table with that new data, without having to close it.
> > > >
> > > > TY
> > > > terence
> > > >
> > > > PS I could do an "SQL Update table set blah blah", but
> > > I
> > > > thought there might be a easier way ?
> > > >
> > > >
> > > >
> > > >
> >
>

__._,_.___
Recent Activity:
MARKETPLACE
A good Credit Score is 720, find yours & what impacts it at freecreditscore.com.
.

__,_._,___

Tidak ada komentar:

Posting Komentar