Results 1 to 8 of 8
  1. #1
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    828

    Form open to specific record criteria

    CompanyIndustry Test.zip

    Hi all,
    Once Again I need some assistance….

    Db Attached, Opens to frmCompany.

    I have a tab (CmdIndustry) on the form that is a subform (sPrimaryIndustry). On click it opens that sub form.

    Once open,
    You can select a Primary Industry from a combo. Combo has a NotInList and DblClick function on it. That then populates if selection made, a listbox (Available Role(s), That has a CmdButton (Toolbox) that should open up a form to add if not in that list box. Once selected items are moved to Selected Role(s),
    Then that populates the Available Function(s) and so on, This too has a tool box CmdButton that should open up form to add new Functions. OK

    The issues I am having that I can not seam to work out are:

    When I dblClick the combo box, it does open form but not go to the actual txt value. It goes to the first record and not the specified record in the combo.

    On NIL Funcition, It does open form, add the new record, but does not go to that record in the form. I want it to go to that record as to fill out the additional form info….

    Example:
    If I open a company, click on industry tab and there is no industry, I select from the combo, lets say I select construction. If I dblclick that I want it to open frmIndusryData, and in the sfrmPrimaryIndustry I want it to go to the record that is Construction.
    If I do above but Not in List, then I want to open the frmIndustryData, and put the new text in and go to that record on the sfrmPrimaryIndustry.

    If I have construction in combo, then If I click on the tool box by available roles because the role is not in the listbox, then I want it to open the same form, carry over the combo value, and go to a new record under the sfrmavailableroles.

    Similar with the tool box button by the Available Function list box, I want to open the frmIndustryData, and carry the values of the combo and the selected role and go to a new record.

    And then requery the combo and list boxes as needed.

    Hope this makes some sense.



    I got part of it down, I just cant put the values where I want them? Would love some assistance with this please…
    Thanks
    Dave

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    You may find this page useful : http://www.baldyweb.com/

  3. #3
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    828
    Hi Rural,
    Thank you for that. I went over it and have book marked it for future use. Unfortunately this is a sub form issue I believe and just not enough info to access those fields as i need.
    Thanks
    Dave

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    You know that Sub Forms load BEFORE the Main Form so that the fields or controls should be available, right?

  5. #5
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    828
    I didnt actually know that so thank you. I just started working with subforms and has been interesting to say the least.
    Thanks
    Dave

  6. #6
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Hi Dave,
    Please have a look at the updated file, should get you closer to your goal, not quite sure what some of the requirements were. You should try to clean up your code as there are quite a few extra lines everywhere that make the logic hard to follow.

    Cheers,
    Vlad
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  7. #7
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    828
    Hi all,
    With a little guidence i did manage to get the dbl click working and am now working on the rest of them. Was to tired last night to finish it up but the dbl click works great....\
    Thanks
    Solution was
    Code:
    Private Sub CboPrimaryIndustry_DblClick(Cancel As Integer)
        Dim LinkCriteria As String
            LinkCriteria = "[TxtPrimaryIndustryID] = '" & Me!CboPrimaryIndustry & "'"
        DoCmd.OpenForm "FrmIndustryData", , , , , , Me.CboPrimaryIndustry
        DoCmd.GoToRecord , , acGoTo, Forms!frmCompany.sfrmCompany.Form.CboPrimaryIndustry
    End Sub

  8. #8
    d9pierce1 is offline Expert
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Oklahoma
    Posts
    828
    CompanyIndustry Test1.zip

    Hi all,
    I thank you all and must give extra thanks to Gicu as he "Nailed It"
    I had tomake some minor adjustments to it but have attached the db with the solution and it works just great.
    This level is way above me and so glad you are sharing.... I love to learn but as one of you members say, i am short on film sometimes....

    Thank you all so much...
    Dave

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

Similar Threads

  1. Open form with specific record
    By Lukael in forum Programming
    Replies: 14
    Last Post: 11-16-2015, 06:31 AM
  2. Open form to specific record
    By zoro.1983 in forum Access
    Replies: 3
    Last Post: 05-31-2015, 11:04 AM
  3. Open form on specific record
    By iky123 in forum Forms
    Replies: 1
    Last Post: 04-11-2012, 09:56 AM
  4. Open form to specific record
    By Two Gun in forum Forms
    Replies: 7
    Last Post: 11-09-2011, 10:00 AM
  5. Open Form to Specific Record
    By batowl in forum Forms
    Replies: 1
    Last Post: 04-08-2011, 10:10 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