Results 1 to 6 of 6
  1. #1
    birth19 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    7

    Searchforrecord Subform Combo Box

    Hi All,

    Basically, I had a form named "previous week".

    It had three cascading combo boxes

    Combo9 - Week Number


    Combo11 - Project Manager
    Combo13 - Project Name

    Now I have sorted it so the subform is included on the query criteria for each combo box.

    I normally use this code with an afterupdate searchforrecord macro where condition.

    ="[Project Name] = " & "'" & [Screen].[ActiveControl] & "'"
    This normal pulls up all the information I need but I understand it is because the above code needs to reference the sub form in some way but I cannot think of it.

    Can someone help me please??

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Want to provide db for analysis? Follow instructions at bottom of my post.

    Project Manager and Project Name are not in the main form RecordSource, they are in subform? Subform object is in Datasheet view?

    I always give subform container controls a name different from the object they hold, like ctrDetails.

    I don't use macros, only VBA.

    Maybe:
    ="Forms!formname!ctrDetails![Project Name] = " & "'" & [Screen].[ActiveControl] & "'"
    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
    birth19 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    7
    Project Manager and Project Name are in the recordsource and in the subform.

    Subform is in a form view.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I don't understand what you are trying to do. Why would both fields be in both main and sub forms? Probably should provide db 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.

  5. #5
    birth19 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    7
    Basically the form is a Weekly entry form, where they report on the project status for the week.

    I have put in a subform that will give the user the option of looking at previous weekly entrys so they can get historic data.

    I have the main form as data input and I have the sub form as locked fields apart from the combo boxes.

    ='[Forms]![Weekly Entry]![Project Name]' = " & "'" & [Screen].[ActiveControl] & "'"
    This is basically what I want to do but can't.

    Im unable to attach due to whopping size.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Having main and sub forms with the same data source is unusual and problematic. Might be workable but just not too familiar with this setup. A split form might suit your situation.

    If my suggested syntax still doesn't resolve issue, I will have to examine and test db. Don't care about real data. You could make a copy without data (a few dummy records could be helpful) and provide it 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.

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

Similar Threads

  1. SearchForRecord statement
    By crowegreg in forum Forms
    Replies: 5
    Last Post: 06-29-2012, 05:40 PM
  2. Convert SearchForRecord Macro to VBA
    By Phred in forum Programming
    Replies: 4
    Last Post: 02-29-2012, 04:02 PM
  3. Replies: 33
    Last Post: 01-13-2012, 07:44 AM
  4. Replies: 5
    Last Post: 01-02-2011, 10:09 AM
  5. Replies: 0
    Last Post: 08-17-2008, 12:19 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