G
Guest
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
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