Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Parameter query or not

$
0
0
Hello,

I am in a quandary deciding my plan of attack. I have a database (8000 records) that has to be accessed through SharePoint. My first attempt of using filters on the main table have resulted in very slow response times (maybe it was set up incorrectly). A parameter query with multiple parameters is my next choice. Users would query the table with their user codes and whether their items are priced or not. The main form has a combo box for user codes and a check box for the pricing (if USP>0 or not).

Scenarios
no parameters
User selected (returns both priced and unpriced)
User chosen and priced selected

This is as far as I got.

Code:

    If Not IsNull(Me.cboFilterUser) Then
   
    If Me.chk_priced.Value = True Then
        strWhere = strWhere & "([User] Like """ & Me.cboFilterUser & "*"") AND [USP]>0 AND "
    ElseIf Me.chk_priced.Value = False Then
        strWhere = strWhere & "([User] Like """ & Me.cboFilterUser & "*"") AND "
    End If
    End If

       
    If IsNull(Me.cboFilterUser) = True Then
        If Me.chk_priced.Value = True Then
        strWhere = strWhere & "[USP]>0 AND "
        Else
        strWhere = strWhere & " AND "
        End If
    End If

Am I on the right track? Where do I go from here?

Viewing all articles
Browse latest Browse all 13329

Trending Articles