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 / Forms Programming / June 2007

Tip: Looking for answers? Try searching our database.

Help with lost focus event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shri - 28 Jun 2007 23:16 GMT
Hi,

I need help with lost focus event. I have a table(tbl_appr) with social,
appseq, audit type as primary key. One social can have many appseq numbers. I
want to have a lost focus event on social so that when a social is entered a
message box should appear with all appseq numbers associated to the social.

Suppose for example I have 000-00-0000(social), 99(appseq), Processor(audit
type)
              000-00-0000, 98, Processor
              000-00-0000, 97, processor

Now when I enter social in the field I should get a meesage "000-00-0000 has
been processed with different appseq numbers 99,98,97. Do you wish to
continue?" Yes/No

Can anyone let me know how can I modify the below code based on the above
example.

Private Sub SSN_LostFocus()

If Not IsNull(SSN.value) Then
   If appraisal_app_seq(Me.SSN.value, Me.AppSeq.value, Me.scorecard.value)
Then
       If scorecard = "Processor" Then
           answer = MsgBox "the above message in the example should go
here",vbyesno , version
       End If
    If answer = vbno then
        exit sub
    end if
     
   End If
End If

End Sub

Below code is in Module

Public Function appraisal_app_seq(SSN As String, AppSeq As String, scorecard
As String) As Boolean
Dim dbslog As Database, rstlog As Recordset
Dim sSql As String
sSql = "SELECT * FROM tbl_appraisalreview WHERE SSN ='" & SSN & "' and
AppSeq ='" & AppSeq & "' and audit_type = '" & scorecard & "'"

Set dbslog = DBEngine.Workspaces(0).Databases(0)
Set rstlog = dbslog.OpenRecordset(sSql, dbOpenSnapshot)
               If rstlog.RecordCount >= 1 Then
                   appraisal_app_seq = True
               Else
                   appraisal_app_seq = False
               End If
          rstlog.Close
End Function

Thanks in advance.
Shri - 29 Jun 2007 15:16 GMT
Can someone please give suggestions on the below code.

Thanks

> Hi,
>
[quoted text clipped - 53 lines]
>
> Thanks in advance.
 
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.