Results 1 to 2 of 2
  1. #1
    snoop832 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2016
    Posts
    4

    Help with Subform Search

    Hi Everyone,

    I have a form with a subform. I would like to use a find record button to search the subform area. I tried using the wizard to create one but it will not work.

    It gives me an error... (the command or action find isn't available now)

    I am assuming I need some kind of set focus thing to get it to work.

    I don't know what to use or how to write it. Any help would be much appreciated. Thanks Guys!

  2. #2
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Are you using macros or code, and where did you place the button? AFAIK, a macro is invoked against, or the actions can only apply to, the object that has the focus. So I believe putting your button on the main form won't work with a macro action meant to work on a sub form. Assuming this is a macro, you might succeed if you set the focus to the sub form first. The reason I don't sound too sure is that I almost never use macros. In case you want to try this, there is a proper syntax for referring to the hierarchy of a form/sub form relationship. To drill down to a subform control, it's
    [Forms]![Main form name]![subform control name].[Form]![control name on subform]
    where [subform control name] is the name of the control that contains the subform, not the subform itself. If you're only trying to refer to the subform, I believe it would be
    [Forms]![Main form name]![subform control name].[Form].SetFocus
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. search subform
    By msasan1367 in forum Access
    Replies: 2
    Last Post: 03-06-2013, 06:41 AM
  2. Search in subform
    By Wayne311 in forum Forms
    Replies: 1
    Last Post: 03-06-2013, 06:09 AM
  3. Replies: 3
    Last Post: 08-22-2012, 03:28 AM
  4. Replies: 7
    Last Post: 08-08-2012, 03:28 PM
  5. Search a Subform
    By libraccess in forum Forms
    Replies: 2
    Last Post: 05-16-2012, 07:07 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