Results 1 to 3 of 3
  1. #1
    kdbailey is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Posts
    228

    Filtering a Form

    I'm pretty experienced with using recordsets, but I have yet to really dive into how to filter forms that are set to a recordsource.



    I've set my form equal to a table titled "Dealer Table" and I've set all of the other fields to their appropriate fields. There's a few items I need addressing...

    1) The user will enter a number into the "Dealer Number" field, which triggers the filter, bringing up all of the other information (address, city, state... etc.) How do I go about filtering the form to bring up the one record belonging to that dealer?

    2) Before a number is identified, I don't want any fields to be showing, how do I prevent the first record on the table from showing?

    3) If any information needs to be adjusted, I want it set to be able to do so, and I can see that it allows for editing on the table, but the only way I can get it to save the record is by changing to another record. Is there a command to "save" or "update" the current record?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    1. you have a continuous form showing all records, with an unbound text box for dealer#
    user enters the # presses enter, in the txtDealer afterupdate event , you filter the records...
    Code:
    private txtDealer_Afterupdate()
    if isNull(txtDealer) then
       me.filterOn = false
    else
       me.filter = "[field]='" & ctxtDealer "'"
       me.filterOn = true
    endif
    2. you WANT all records, then filter on them when user fills in box

    3. the data is LIVE, you can edit it once it filters.

  3. #3
    kdbailey is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Posts
    228
    I used the code, it is still showing info for the first record when there is nothing entered into txtdealerno. Is it possible to not show any record if no dealer number is specified? Or do I have to change the control sources through vba?

    What I was looking for was the command "docmd.RunCommand acCmdSaveRecord".

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

Similar Threads

  1. Filtering a form
    By George in forum Access
    Replies: 1
    Last Post: 01-17-2015, 01:29 PM
  2. Replies: 15
    Last Post: 04-17-2012, 01:42 PM
  3. Filtering a sub form.
    By moss555 in forum Forms
    Replies: 5
    Last Post: 12-28-2011, 04:53 PM
  4. Replies: 6
    Last Post: 11-17-2011, 10:50 PM
  5. Form Filtering
    By Kapelluschsa in forum Forms
    Replies: 5
    Last Post: 06-06-2011, 12:05 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