Results 1 to 3 of 3
  1. #1
    DubCap01 is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Sep 2014
    Location
    Dubbo, Australia
    Posts
    104

    Dynamically updating a subform's content


    Hi all,

    Have a form with a subform. Main form has field [Title] and subform (only) has matching field [Title] and set to continuous forms.
    The plan is, type in the name of a movie into the main form, so after each keystroke the subform [title] requeries/refreshes to display any matching entries in the underlying table [TblMovies] with the same characters.
    For instance, typing into the main form field the characters "The" would link to titles aka 'The Hunt for Red October' or 'The Sum Of All Fears', and so on.
    Not sure how to code this, can anyone help out please? I'm sure there's an easy way to do this, but I have been up for 18 hours now and have hit the wall...
    Form is called [FrmAddMovie], and subform is called [FrmAddMovieSub]
    thanks in anticipation
    Pete

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    in your unbound textbox control for entering your search text, in the change event, try

    Code:
    if mytextboxname.text="" then me.FrmAddMovieSub.form.filter="" else me.FrmAddMovieSub.form.filter="Title='" & mytextboxname.text & "*'"
    me.FrmAddMovieSub.form.filteron=true

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

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

Similar Threads

  1. Replies: 10
    Last Post: 09-29-2016, 08:00 PM
  2. Replies: 28
    Last Post: 01-28-2015, 02:24 PM
  3. VBA Doesnt add content of subform to table
    By shabbaranks in forum Programming
    Replies: 14
    Last Post: 12-16-2011, 03:47 AM
  4. Replies: 5
    Last Post: 06-28-2011, 06:40 PM
  5. Replies: 0
    Last Post: 02-27-2011, 07:03 AM

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