|
-
Jan 10th, 2011, 04:32 PM
#1
Thread Starter
Member
Search Form Continuous Reloading After Split and Placed On Server
I'm using Access 2007. I created a split database and protected the front end as an accde file. I have a document search form that queries a listbox of documents to choose from. It worked great before I split it, converted the front end to accde, and put it on our server. Now when it opens it blinks like it is reloading every time you try and select a record from the document list. There aren't very many records, maybe 30 max. Also, there are no errors. I'm not sure what I am missing, could someone please take a look at the code behind this form and see if it something obvious or is there something I need to do specifically for a filter/sort/list form before putting it onto a shared server (I work for an environmental state government agency where the server is secured)?
Code:
Option Compare Database
Option Explicit
Dim fslDocs As FilterSortListBox
Private Sub cboseries_afterUpdate()
applyFilter
End Sub
Private Sub cboseries_Enter()
Dim strWhere As String
Dim strSql As String
If Not Trim(cbotype & " ") = "" Then
strWhere = "WHERE DocType = " & cbotype & " AND blnDocArchived <> -1 "
End If
strSql = "SELECT DISTINCT tblDocInfo.[DocSeries] FROM tblDocInfo "
strSql = strSql & strWhere & "ORDER BY tblDocInfo.[DocSeries]"
Debug.Print strSql
cboseries.RowSource = strSql
cboversion = Null
End Sub
Private Sub cbotype_AfterUpdate()
Me.cboseries = Null
Me.cboversion = Null
Call applyFilter
End Sub
Private Sub cbotype_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me!cbotype.SetFocus
Me!cbotype.Dropdown
End Sub
Private Sub cboseries_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me!cboseries.SetFocus
Me!cboseries.Dropdown
End Sub
Private Sub cboversion_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me!cboversion.SetFocus
Me!cboversion.Dropdown
End Sub
Private Sub cboversion_AfterUpdate()
applyFilter
End Sub
Private Sub cboversion_Enter()
Dim strWhere As String
Dim strSql As String
If Not Trim(cboseries & " ") = "" Then
strWhere = "WHERE DocSeries = " & cboseries & " AND blnDocArchived <> -1 "
Else
cbotype = Null
End If
strSql = "SELECT DISTINCT tblDocInfo.[DocVersion], getStrVersion([DocVersion]) AS strVersion FROM tblDocInfo "
strSql = strSql & strWhere & "ORDER BY tblDocInfo.[DocVersion]"
Debug.Print strSql
cboversion.RowSource = strSql
End Sub
Private Sub cmdCancel_Click()
DoCmd.Close acForm, Me.Name
End Sub
Private Sub cmdClear_Click()
fslDocs.FilterList ("")
End Sub
Private Sub cmdOK_Click()
Me.Visible = False
End Sub
Private Sub cmdseries_Click()
fslDocs.SortList ("DocSeries")
End Sub
Private Sub cmdtitle_Click()
fslDocs.SortList ("DocTitle")
End Sub
Private Sub cmdtrackingnumber_Click()
fslDocs.SortList ("TrackingNumber")
End Sub
Private Sub cmdtype_Click()
fslDocs.SortList ("SOPType,DocSeries,DocVersion")
End Sub
Private Sub cmdversion_Click()
fslDocs.SortList ("DocVersion")
End Sub
Private Sub Form_Load()
Call FindAsUTypeLoad(Me)
Set fslDocs = New FilterSortListBox
fslDocs.Initialize Me.lstDocuments
End Sub
Public Sub applyFilter()
Dim strType As String
Dim strVersion As String
Dim strSeries As String
Dim strFilter As String
If Not Trim(Me.cbotype & " ") = "" Then
strType = "DocType = " & Me.cbotype & " AND "
End If
If Not Trim(Me.cboversion & " ") = "" Then
strVersion = "DocVersion = " & Me.cboversion & " AND "
End If
If Not Trim(Me.cboseries & " ") = "" Then
strSeries = "DocSeries = " & Me.cboseries & " AND "
End If
strFilter = strType & strSeries & strVersion
strFilter = Left(strFilter, Len(strFilter) - 5)
fslDocs.FilterList (strFilter)
End Sub
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|