Results 1 to 6 of 6
  1. #1
    raton is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Feb 2012
    Posts
    22

    search form with three text box option not working

    i have search form with a subform. Subform based on a query.
    there are 3 text boxes. with three different criteria for search
    example. search by name, search by date, serch by number
    three radio button which is used to highlight one search text box at a time
    problem
    write name in name txt box click search button requery subform
    but when i click another radio button to highlight another txt box
    the subform is not being clean. it contain the prior result
    but i want to clean the subform everytime i select the radio button.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    You need to unfilter the subform before applying new filter.

    Show code you have or provide project for analysis.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    raton is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Feb 2012
    Posts
    22
    form is serached by query
    query1
    field, name, number, id,
    criteria Forms!frmname!textbox1
    or Forms!frmname!textbox2
    or Forms!frmname!textbox3

    three radio button in a option group code

    Me.text1.Visible = True
    Me.text2.Visible = False
    Me.text3.Visible = False
    Me.Qservice_subform.Requery
    End Sub












    Private Sub mnumber_GotFocus()
    Me.text1.Visible = False
    Me.text3.Visible = False
    Me.text2.Visible = True
    Me.Qservice_subform.Requery
    End Sub






    Private Sub rdate1_GotFocus()


    Me.text1.Visible = False
    Me.text3.Visible = True
    Me.text2.Visible = False
    Me.Qservice_subform.Requery
    End Sub

    private sub cmd1_click()

    Me.Qservice_subform.Requery
    end sub

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    That didn't help. I don't understand what radio buttons have to do with the search textboxes. Appears I will have to see the project.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    raton is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Feb 2012
    Posts
    22
    i want to make a search form
    a text box will be there. and a cmd button
    i want to retrieve query result
    the query has 5 field ( field1, field2,field3,field4,field5,)
    i want the search by field1, or field2, or field3,
    as the textbox is only one, i have used 3 radio button
    to choose that now the search will be happened depending on the field1 of the query
    (radio button is used to choose on which field the search will happen)
    how can i do that pls show me thw way..................

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    As far as I can tell, none of the code you show does anything to alter the search parameters. Also, the controls referenced in the query statement are not the same names as you show in the VBA code. If you are showing alias information and not your actual code, that just confuses. Show your real code. Review this tutorial about filter criteria in queries http://datapigtechnologies.com/flash...tomfilter.html

    Possibly what you need is wildcard in your filter criteria as demonstrated by the tutorial.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Search Button in a Form not Working
    By spideynok in forum Forms
    Replies: 30
    Last Post: 03-29-2012, 01:10 AM
  2. Working with Radio Buttons and Option Groups
    By queenbee in forum Access
    Replies: 1
    Last Post: 04-29-2011, 02:25 PM
  3. Option Groups - change value from number to text
    By nchesebro in forum Programming
    Replies: 10
    Last Post: 02-09-2011, 03:52 PM
  4. Converting Option value to text
    By James3mc in forum Forms
    Replies: 4
    Last Post: 11-28-2009, 11:19 PM
  5. Refresh form search text box
    By oxicottin in forum Forms
    Replies: 2
    Last Post: 11-19-2007, 02: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