SQL statment in subform doesn't work when running from Parent form
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
Microsoft AccessSQL
Last Comment
dsg138
8/22/2022 - Mon
Jim Horn
>When I access it through the parent form
sSQL = "DELETE * FROM QSTNRT_SELECTION_PROB WHERE [QSTNRT_SELECTION_PROB_PID] = " & Me.frmResponsesSubformObjectName.Forms!ProbSelPID
dsg138
ASKER
Thanks for the quick reply Jim...
I now get Method or Data Member not found.
dsg138
ASKER
Raised the pts some, if there are any other suggestions... Thanks!
sSQL = "DELETE * FROM QSTNRT_SELECTION_PROB WHERE [QSTNRT_SELECTION_PROB_PID