Results 1 to 2 of 2
  1. #1
    Join Date
    May 2013
    Posts
    19

    Search as you type Row Source Alteration

    I have been working to impliment the example at the link below (just as an FYI, great tutorial!) It goes through how to create a search as you type list box. I have run into one problem I was hoping someone could help with. It provides the code below in one of the steps.



    Code:
    Private Sub txtSearch_Change()
    'CODE THAT HANDLES WHAT HAPPENS WHEN THE USER TYPES IN THE SEARCH BOX
    Dim strFullList As String
    Dim strFilteredList As String
    
    
    10 If blnSpace = False Then
    20 Me.Refresh 'refresh to make sure the text box changes are actually available to use
    
    'specify the default/full rowsource for the control
    30 strFullList = "SELECT RecordID, First, Last FROM tblNames ORDER BY First;"
    
    'specify the way you want the rowsource to be filtered based on the user's entry
    40 strFilteredList = "SELECT RecordID, First, Last FROM tblNames WHERE [First] LIKE ""*" & Me.txtSearch.Value & _
    "*"" OR [Last] LIKE ""*" & Me.txtSearch.Value & "*"" ORDER BY [First]"
    
    'run the search
    50 fLiveSearch Me.txtSearch, Me.lstItems, strFullList, strFilteredList, Me.txtCount
    60 End If
    
    End Sub
    In row 30 & 40 the Row source needs to be added. I have taken the Row source from my list box and added as specified where I have run into problems is inplementing into line 40 where text searching begins. Please see my row source code below. Any help would be greatly appreciated!

    Thanks

    Code:
    SELECT tblQuestions.QstnID, tblQuestions.QstnText, tblQuestions.SrvID FROM tblQuestions WHERE (((tblQuestions.SrvID)=[Forms]![frmSurveyResponses]![cboSurvID]));

  2. #2
    Join Date
    May 2013
    Posts
    19
    The link as promised, forgot to include above

    http://www.opengatesw.net/ms-access-...pe-Access.html

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Process Alteration Database Design Methodology.
    By cap.zadi in forum Database Design
    Replies: 9
    Last Post: 10-30-2012, 03:51 AM
  2. problems with search as you type forms
    By sk88 in forum Access
    Replies: 1
    Last Post: 06-27-2012, 02:01 PM
  3. Search as you type
    By CaptainKen in forum Programming
    Replies: 19
    Last Post: 04-25-2012, 12:55 PM
  4. search as you type in combo box
    By pratim09 in forum Forms
    Replies: 3
    Last Post: 08-05-2011, 07:46 AM
  5. Replies: 3
    Last Post: 06-04-2011, 12:23 PM

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
  •  
Other Forums: Microsoft Office Forums