RE: Inserting calculation field on form
- From: SteveS <sanfu at techie dot com>
- Date: Fri, 8 Apr 2005 16:17:02 -0700
"Ammo" wrote:
> Hi Steve,
>
> I have emailed you the db as requested.
>
> Kind Regards
>
> Ammo
>
I received your database. After looking at it, I was still puzzled as to why
DSUM() wasn't working. So before I created the new queries, I took another
look at your formula for "TotalGrantRemaining".
There I was, looking at the form, thinking about creating the queries when
it happened!! Kind of like the guy that stayed up all night wondering where
the sun went when it went down, when it finally dawned on him! <g>
The DSUM() function is nothing more than a really, really limited query. You
have a source (the table), a field to search and a where clause (without the
where). And in a query, you *can't* use "Me.ControlName". You *have* to use
"Forms!FormName.ControlName".
Here is the new control source for "TotalGrantRemaining". (I rearranged the
terms)
=[AvailableGrant]-DSum("[AmountGrantAllocated]","tbl_GrantApplicant","[GrantStatus] = True and [GrantPotNumber] = " & Forms!frm_GrantPot.GrantPotNumber)
Then, to get the "TotalGrantRemaining" to update when you change the
subform, from the databasewindow, open "frm_GrantApplicant subform" in design
view. In the FORM AfterUpdate event, enter: Me.Parent.Refresh
It should look like this:
Private Sub Form_AfterUpdate()
Me.Parent.Refresh
' you might be able to to use instead
' Me.TotalGrantRemaining.Requery
End Sub
Two simple changes.... :-D It should work now......
---
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
.
- Follow-Ups:
- RE: Inserting calculation field on form
- From: SteveS
- RE: Inserting calculation field on form
- References:
- Inserting calculation field on form
- From: Ammo
- RE: Inserting calculation field on form
- From: SteveS
- RE: Inserting calculation field on form
- From: Ammo
- RE: Inserting calculation field on form
- From: SteveS
- RE: Inserting calculation field on form
- From: Ammo
- Inserting calculation field on form
- Prev by Date: RE: DoCmd.RunSQL Problem
- Next by Date: RE: Inserting calculation field on form
- Previous by thread: RE: Inserting calculation field on form
- Next by thread: RE: Inserting calculation field on form
- Index(es):
Relevant Pages
|
|