By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,287 Members | 1,524 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,287 IT Pros & Developers. It's quick & easy.

dblclick event

lee123
100+
P: 556
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

Expand|Select|Wrap|Line Numbers
  1. docmd.openform "joborderf",,,"Customerlsal=" & Customerlsal
or i have tried this:

Expand|Select|Wrap|Line Numbers
  1. docmd.openform "joborderf,,,"forms!customerf!customerlsal=" & Customerlsal
and this:

Expand|Select|Wrap|Line Numbers
  1. docmd.openform "joborderf",,,"forms!customerf!customerlsal=" & form.customerlsal
i don't understand if this can be done in a subform

lee123
Feb 27 '08 #1
Share this Question
Share on Google+
4 Replies


Expert Mod 2.5K+
P: 2,545
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
Expand|Select|Wrap|Line Numbers
  1. 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
Feb 28 '08 #2

lee123
100+
P: 556
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:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "JobOrderF", , , "CustomerLsal=" & Me![paidsf].Form![CustomerLsal]
lee123
Feb 28 '08 #3

NeoPa
Expert Mod 15k+
P: 31,768
Is your subform in a Tab control?
Feb 29 '08 #4

NeoPa
Expert Mod 15k+
P: 31,768
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.
Feb 29 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.