Re: What happens when data in control is updated

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



first off, thanks for the interest!

in the interim, i've dug out some heavy reading material on a2k development
and been reading about 'recordsets'....

but, i'm not sure i understand all your concerns in the response you post.

future_visit is not computed in this particular; it is computed in a
predecessor query (query3) which used yet another query (the one i coined
'Sort by Month'). suffice it to say that in query3, there is a unique record
for every lastname which corresponds with a nextvisit date.

i think i actually did try putting the criterion

[Forms]![Screening Log]![On-Study Date]

in query5 under onstudydate and that that had no effect, so i figured i
could assign/pass it in to the query when i wrote it as expressed in my SQL
code. by saying [Forms]![Screening Log]![On-Study Date] AS [On-Study Date] i
figured it would have the effect of giving Query5 the ability to use the
revised value of On-Study Date.


"tina" wrote:

> well, at best your SQL would return the date from the form as a static value
> in every record returned by the query. it's not included in the WHERE
> clause, or in any calculated field in the query, so i don't see how it's
> being "used" in calculating a future_visit date.
>
> what is the basis of the future_visit value? are you adding x number of days
> or months to the onstudydate value?
>
> hth
>
>
> "Ted" <Ted@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:467526E2-496F-4F67-B74F-14CF27FE5781@xxxxxxxxxxxxxxxx
> > to this newbie, that seems like a viable question to ask, so if you're
> > laughing, perhaps you ought to be reading another posting....
> >
> > anyway, my point is to do with the availability of the 'new' value in a
> text
> > control (date) whilst the user is contuing to use/view the information on
> the
> > form housing the text control which he modified; e.g. i have a date
> control
> > that takes the 'onstudydate' of a person and want to compute the
> > 'futurevisit' date based on it. both values appear as date controls on the
> > same form.
> >
> > perhaps this is getting too far afield of the subject heading, but my vba
> > code looks like
> >
> > Private Sub On_Study_Date_AfterUpdate()
> > Dim Future_Visit As Date
> > Dim On_Study_Date As Date
> >
> > If Me.Dirty Then
> > If Not IsNull(Me.IRB_) Then
> > Me.Future_Visit.Enabled = True
> > Me.Future_Visit.Locked = False
> > Me.Future_Visit.SetFocus
> > Me.Future_Visit.Value = DLookup("FollowUp", "Query5")
> > Me.On_Study_Date.SetFocus
> > Me.Future_Visit.Enabled = False
> > Me.Future_Visit.Locked = True
> > ' Me.Future_Visit.Value = "01/01/1900"
> > End If
> > End If
> > End Sub
> >
> >
> > and the Query5 SQL code reads thusly:
> >
> > SELECT S.[Last Name], S.[First Name], S.[IRB#], S.[Study #], S.[Seq#],
> > S.Months, [Forms]![Screening Log]![On-Study Date] AS [On-Study Date],
> > S.Schedule, S.[F/U Status], S.FollowUp
> > FROM [Sort By Month] AS S INNER JOIN Query3 AS Q ON (S.[Last Name] =
> Q.[Last
> > Name]) AND (S.FollowUp = Q.NextVisit)
> > WHERE (((S.[Last Name])=[Forms]![Screening Log]![Last Name]));
> >
> > i wish i could figure out how to use the newly entered on-study date
> > information in this vba to compute the desire value of future_visit's.
> using
> >
> > [Forms]![Screening Log]![On-Study Date] AS [On-Study Date]
> >
> > in the SQL code did not have the 'intended' effect, i.e. 'passing' the
> > updated value to the query.
> >
> > any help'd be welcome.
> >
> >
> >
>
>
>
.



Relevant Pages

  • Re: Reusing SQL data-related logic, replacing weird modules and improving Class::DBI
    ... and this sort of thing is usually reserved ... few lines of SQL, and this may improve clarity and amount of code. ... Essentially, your query is immutable. ... And I've got control! ...
    (comp.lang.perl.modules)
  • Re: Getting a total control to find totals for last 7 days via a q
    ... I actually based the form on that particular SQL, (so none of this aspect is ... A different query will be needed that groups on ... these other two queries. ... I want to set the criteria from the control box and not the ...
    (microsoft.public.access.queries)
  • RE: Help Needed
    ... Yes this is an Access form, and this form is being used to gather criteria to ... be used in the SQL Query. ... By removing the 'Control Source' property, I can no longer change the ... it sounds like this is kind of a query by form setup. ...
    (microsoft.public.access.queries)
  • Re: Having Trouble with Bound Form
    ... Thanks for your response Steve. ... the form and I don't see any SQL that is performing the type of update ... Maybe there is a saved query that is being used in ... As far as the control (which is bound to a date field in ...
    (microsoft.public.access.formscoding)
  • RE: Opening a form based on a query
    ... Where exactly is the above SQL sitting? ... the RowSource of a control? ... try pasting your SQL statement into a query and running the ... now each combo box ROWSOURCE is based on SELECT DISTINCTROW SQL ...
    (microsoft.public.access.forms)