I want to get the total sum up of annual approved budget relating to 3 fields
from Budget entry form to budget analysis field (txtannlapprvbudg). I have
used following codes.
Private Sub txtapprvbudg_GotFocus()
Dim strfind As String
With rsbe
.FindFirst (strfind)
If rsbe.NoMatch = False Then
txtapprvbudg.Value = "select sum([Annual Approved Budget]) into val from
tblBudget where [Project No]='" & Me![cmbprojno] & "' and [Activity Code]='"
& Me![cmbactcode] & "' and [Objective Code]='" & Me![cmbobjcode] & " ' and
[Donor]='" & Me![cmbdonorcode] & "'"
With rsbe
.FindFirst (strfind)
If rsbe.NoMatch = False Then
txtapprvbudg.Value = "select sum([Annual Approved Budget]) into val from
tblBudget where [Project No]='" & Me![cmbprojno] & "' and [Activity Code]='"
& Me![cmbactcode] & "' and [Objective Code]='" & Me![cmbobjcode] & " ' and
[Donor]='" & Me![cmbdonorcode] & "'"
Else
MsgBox "Sorry the Code does not exist, reenter the Codes again.",
vbInformation, "FEMIS SYSTEMS : Activity Code"
cmbprojno.SetFocus
cmbprojno.Value = ""
cmbdonorcode.Value = ""
cmbactcode.Value = ""
cmbobjcode.Value = ""
End If
End With
Could you please advice me on this coding.
Thank you very much and waiting for your answer.
Binod
Douglas J Steele - 31 Jan 2006 11:55 GMT
What is rsbe? Where do you instantiate it?

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> I want to get the total sum up of annual approved budget relating to 3 fields
> from Budget entry form to budget analysis field (txtannlapprvbudg). I have
[quoted text clipped - 37 lines]
>
> Binod