Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

MsAcess ADO and DOA coding

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Binod - 31 Jan 2006 04:57 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.