Open form if I click on data in a subform

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jozo
    New Member
    • Sep 2008
    • 6

    Open form if I click on data in a subform

    Dear All,
    I have main form "Job" and one subform "Offer"
    In a subform I have combo box Contacts.
    How can I open form Contacts if I dbl click on a combo box in my subform where condition ID = Contacts!

    Thank you in advance!
  • wassimdaccache
    New Member
    • Apr 2007
    • 222

    #2
    on event double click try to insert this code
    Code:
     
    Dim stDocName As String     
    Dim stLinkCriteria As String      
    stDocName = "Contacts"          
    stLinkCriteria = "[ID]=" & [contacts]  
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    Also you can you use from your toolbar create wizard button and ACCESS will create you the code


    Regards,

    Comment

    • Jozo
      New Member
      • Sep 2008
      • 6

      #3
      Dear!

      I tried to insert your code but it is not correct.
      Wrong: stLinkCriteria = "[ID]=" & [contacts]
      Can't find this data!

      Rgds

      Comment

      • Jozo
        New Member
        • Sep 2008
        • 6

        #4
        I find answer...
        DoCmd.OpenForm "Contacts", , , "[cID]=" & [oCustomer], , acDialog
        ID - primary key in a tabele Contacts
        Customer - name of the combo box in a subform "Offer"

        Rgds....

        Comment

        Working...