dblclick event

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lee123
    Contributor
    • Feb 2007
    • 556

    dblclick event

    hey all i just wanted to ask if anyone knows how to do this, i want to be albe to dbl click in a subform to open up form with the same ID i have did this code but i can't seem to make it work

    Code:
    docmd.openform "joborderf",,,"Customerlsal=" & Customerlsal
    or i have tried this:

    Code:
    docmd.openform "joborderf,,,"forms!customerf!customerlsal=" & Customerlsal
    and this:

    Code:
    docmd.openform "joborderf",,,"forms!customerf!customerlsal=" & form.customerlsal
    i don't understand if this can be done in a subform

    lee123
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Hi Lee. The syntax for referring to controls on a subform is Me![subformname].Form![controlname] (see Referring to Items on a Subform in the HowTo section of this forum at http://www.thescripts.com/forum/thread599404.html)

    The first example DoCmd you gave was nearest correct. Try changing it to
    Code:
    docmd.openform "joborderf",,,"Customerlsal=" & Me![subformname].Form![Customerlsal]
    replacing subformname with the name of your subform.

    The criterion string in your second example was not correctly formed, and nor was the reference to the subform control in your third example.

    -Stewart
    Last edited by Stewart Ross; Feb 28 '08, 11:06 AM. Reason: typo

    Comment

    • lee123
      Contributor
      • Feb 2007
      • 556

      #3
      hey thanks for getting back with me on this but the code you gave me to try didn't work. i also tried some of the ones that NeoPa provided on the link you gave me but no luck this is how i entered the code:

      Code:
      DoCmd.OpenForm "JobOrderF", , , "CustomerLsal=" & Me![paidsf].Form![CustomerLsal]
      lee123

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32668

        #4
        Is your subform in a Tab control?

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32668

          #5
          One thing I'd suggest you do :
          1. Select the item named [paidsf].
          2. Check the Properties pane (Alt-Enter).
          3. Does the Properties pane title read "Subform/Subreport: paidsf"?

          If NOT, then something's not quite as it should be. Remember, we're not talking about the .SourceObject property here but the .Name one.

          Let us know how you get on.

          Comment

          Working...