Results 1 to 8 of 8
  1. #1
    zaza123 is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    19

    Help I dunno y it doesnt work

    I wanna create a access form with a save button which will save the data keyed in the listbox & textbox onto a microsoft access table. I would also need a filter button from the form which will filter what ever data is keyed in the list box & textbox and appear in the microsoft access table....I cant seem to get both of them to work....Im kinda new to Access so yeah & my programming aint good..

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,920
    Bind the form to the table, bind controls to the fields, whatever is entered into the controls is entered directly to table. Don't understand what you mean by 'will filter what ever data is keyed in the list box & textbox and appear in the microsoft access table'. Show the code you have written so far.
    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
    zaza123 is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    19
    What i mean is...when i have key in any data in the list box or the textbox, when i press the button, it will look through the table which i have all my data and show those that match with the data inputed in my listbox & textbox....the similar data will appear in another table....

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,920
    Don't try to programatically filter directly on table. Use a form that is bound to the table. Open the form with filter criteria. Click button on first firm to run code that will open second form with filter criteria:
    If Not IsNull(Me.textbox) And Not IsNull(Me.listbox) Then
    DoCmd.OpenForm "formname", , , "fieldname1='" & Me.textbox & "' AND fieldname2='" & Me.listbox & "'"
    Else
    MsgBox "Must enter criteria in both textbox and listbox."
    End If
    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
    zaza123 is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    19
    Sorry I still dont understand so i will have 2 forms am i right...And to bound the table to form , and field to table, all u have is adjust from the control source right???(Sorry im kinda new at access so im super blur...Thx alot for ur help & patience)

  6. #6
    zaza123 is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    19
    This is what i have done so far!!!

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,920
    Okay, that is working. You use Embedded Macro. The code sample I gave is VBA code, but should be able to replicate in macro.

    Code could open another form that displays all records with the matching values from first form. However, can't use bound controls to enter a criteria to search for, this would change the value in the table record.
    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.

  8. #8
    zaza123 is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    19
    Thx Alot June ill try to solve the rest thx!!!!

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

Similar Threads

  1. Record Set won't work
    By claven123 in forum Programming
    Replies: 14
    Last Post: 01-12-2011, 01:29 PM
  2. Replies: 1
    Last Post: 01-12-2011, 10:11 AM
  3. SQL SubQuery Does Not Work
    By saascuba in forum Access
    Replies: 3
    Last Post: 11-04-2010, 01:59 PM
  4. Replies: 2
    Last Post: 01-14-2008, 12:15 PM
  5. My subform doesnt refresh????? HELP!
    By LiamMurphy in forum Forms
    Replies: 1
    Last Post: 03-09-2006, 09:08 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