troubleshooting Question

SQL statment in subform doesn't work when running from Parent form

Avatar of dsg138
dsg138 asked on
Microsoft AccessSQL
5 Comments1 Solution264 ViewsLast Modified:
Experts, here is a quick SQL Statement syntax question.

I have a subform called frmResponses.

I have a button with an OnClick event that runs the following SQL statment.
sSQL = "DELETE * FROM QSTNRT_SELECTION_PROB WHERE [QSTNRT_SELECTION_PROB_PID] = Forms![frmResponses]![ProbSelPID]"

It works correctly when I run it directly from frmResponses.

frmResponses is a subfrom on frmTree2 (the parent from).

When I access it through the parent form, frmTree2, I get prompted for...
Forms![frmResponses]![ProbSelPID]
Access doesn't recognize it...

I've tried numerous things such as:
Forms![frmTree2]![frmResponses]![ProbSelPID]
Forms.[frmTree2].[frmResponses].[ProbSelPID]

Forms![FrmTree2]![ProbSelPID]

Any ideas?

Thanks in advance...  

-dsg
ASKER CERTIFIED SOLUTION
dsg138

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros