Delete all records from a subform

T

TG(Denmark)

I want to delete records in a subform, the recordsource for the form
is:

SELECT * FROM (TEST INNER JOIN SAMPLE ON
TEST.SAMPLE=SAMPLE.ID_NUMERIC) INNER JOIN RESULT ON
TEST.TEST_NUMBER=RESULT.TEST_NUMBER WHERE
(((SAMPLE.JOB_NAME)=forms.frmJobSampleTestResult.Job)) ORDER BY
RESULT.TEST_NUMBER, RESULT.ORDER_NUMBER;

I have tried with this:

DoCmd.RunSQL "DELETE * FROM (TEST INNER JOIN SAMPLE ON
TEST.SAMPLE=SAMPLE.ID_NUMERIC) INNER JOIN RESULT ON
TEST.TEST_NUMBER=RESULT.TEST_NUMBER WHERE
(((SAMPLE.JOB_NAME)=forms.frmJobSampleTestResult.Job));"

but appearently this is not the right syntax, maybe it shoud be
something like:

DELETE * FROM Test WHERE/HAVING???

Can anyone help me?

TG(DK)
 
S

Stefan Hoffmann

hi,

TG(Denmark) said:
I want to delete records in a subform, the recordsource for the form
is:
DoCmd.RunSQL "DELETE * FROM (TEST INNER JOIN SAMPLE ON
TEST.SAMPLE=SAMPLE.ID_NUMERIC) INNER JOIN RESULT ON
TEST.TEST_NUMBER=RESULT.TEST_NUMBER WHERE
(((SAMPLE.JOB_NAME)=forms.frmJobSampleTestResult.Job));"

but appearently this is not the right syntax, maybe it shoud be
something like:
Copy your record source into a new query, replace your form reference to
the correct syntax. Switch to the designer and use the toolbar to switch
it to a delete statement...


mfG
--> stefan <--
 
T

TG(Denmark)

hi,




Copy your record source into a new query, replace your form reference to
the correct syntax. Switch to the designer and use the toolbar to switch
it to a delete statement...

mfG
--> stefan <--

Thanks, I will go that way
/TG(DK)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top