Hi. I'll start by apologising that my question may seem a little novice to some, but this one's tearing my hear out!!
I am trying to create 'delete agent' button. So I have about six tables, and I have a delete agent form, where the user is selected from a list, confirmed in another field, then when the user clicks the button, any record in all six tables containing the selected agent's name will be deleted.
The confirmation field on the Delete Agent page is not associated to any tables. Every time I click on the delete agent button, it asks me to enter a parameter value for DeleteAgent.DelAgt. Here's an example of the code I'm using in the macro:
Code:
DELETE *
FROM Table1
WHERE (EXISTS
(SELECT * FROM Table1 WHERE Table1.Agent = DeleteAgent.DelAgt = True));
I'm sure it's a matter of syntax, and I think it's because the "DeleteAgent.DelAgt" bit is referring to a table, not a form.
Is this possible to do, or do I have to link it to a table?
If it's unclear what I need, please say so.
Thanks people.
.