Results 1 to 3 of 3
  1. #1
    raffi is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Location
    Inside a Sub Procedure
    Posts
    88

    Advanced Search Field in a form

    alright so i have a query named "Q Item" with the following fields, "ItemID" "ItemName" and i have a form Named "F Item" with a text field in it called "TxtItem"



    In "Q item" within the criteria of the "ItemName" i have the following code

    Code:
    Like "*" & [forms]![F Item]![TxtItem] & "*"
    i'v turned this "Q Item" Into a Form, ( the multiple Form Type ) Named it "F Item Sub" and i'v placed this "F Item Sub" into the "F Item" as a sub form, and i have also added an event "after update" on the "TxtItem" field, which requery's the "F Item Sub" After updating the "TxtItem"

    ok so now the "TxtItem" field is updating the "F Item Sub" within the "F Item" form, its updating after i click tab or upon exiting, thats an okey way to search, but.

    what im trying to aim at is to update the "F Item Sub" every single time i write a letter in the "TxtItem" while im still within the "TxtItem" Field,

    thank you in advance for ur time and i hope this already good already operational search field could be utilized if needed

    P.S i tryed using the "On Change" "On Press" all the events and it didn't work out

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    see http://allenbrowne.com/appfindasutype.html for sample.

    Choose a naming convention that DOES NOT allow embedded spaces -- it will save you many syntax errors with time. Name things with meaningful names.
    Good luck.

  3. #3
    raffi is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Mar 2014
    Location
    Inside a Sub Procedure
    Posts
    88
    hey thx for the sample which u have provided, but i was just thinking isn't there a way to keep the codes i have as they are and add a VBA code " On Change event " within TxtItem Field?

    i have this code below which will update " letter by letter as i type " one column, in this case "company" , based on what i type in a field named "CboFilter" but the source of the form have to be the query which is being filtered, in order for it to work, but i want this to be operational in the data entry conjunction table form, and to look up another sub form from another table, so i have to reference the sub form to filter within the code below, but i dono how to add it =l


    Code:
    Private Sub CboFilter_Change()
      
      If Nz(Me.CboFilter.Text) = "" Then
        Me.Form.Filter = ""
        Me.FilterOn = False
        
       ElseIf Me.CboFilter.ListIndex <> -1 Then
        Me.Form.Filter = "[Company] = '" & _
                         Replace(Me.CboFilter.Text, "'", "'") & "'"
        Me.FilterOn = True
        
    
    
      Else
        Me.Form.Filter = "[Company] Like '*" & _
                         Replace(Me.CboFilter.Text, "'", "'") & "*'"
        Me.FilterOn = True
        
        End If
        
      Me.CboFilter.SetFocus
      Me.CboFilter.SelStart = Len(Me.CboFilter.Text)
    
    
    End Sub

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

Similar Threads

  1. Replies: 3
    Last Post: 09-02-2013, 04:33 PM
  2. Replies: 5
    Last Post: 08-05-2013, 09:47 AM
  3. Advanced Search / Query Method
    By rabryant1 in forum Queries
    Replies: 10
    Last Post: 06-15-2013, 07:47 PM
  4. Replies: 3
    Last Post: 08-22-2012, 03:28 AM
  5. Replies: 7
    Last Post: 08-08-2012, 03:28 PM

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