Hi all,
Im new to access and i need some help. This is my situation. I have a listbox (called list0) on a form (called frmDeleteClientContact). The listbox displays a list of clients by Lastname and Firstname from table tblClient. tblClient contains other fields but they are not relevent as all i need is Lastname and Firstname for the query. This is my row source for the listbox:
SELECT tblClient.ClientID, tblClient.LastName, tblClient.FirstName FROM tblClient ORDER BY [LastName];
So the listbox displays data like this from tblClient:
Lastname Firstname. Eg. Littlewood Rob.
I am creating a Delete action query that has all the fields from tblClient in it. I want the fields Lastname and Firstname to hold the criteria for the query. So when a client is selected in the listbox (list0) the lastname in the listbox is the criteria for Lastname and the firstname in the listbox is the criteria for Firstname if you understand me. So then when the query is run it deletes the selected record in the tblClient and the listbox is updated so the deleted client is no longer displayed. I can get the delete query working if i put [Please Enter Surname of client to delete:] into the criteria of the Lastname field. But i want it so it runs through a form and both the Firstname & Lastname is selected from the listbox.
I really am stuck,
Any help would be greatly appriciated.
Thanks
Jim
Im new to access and i need some help. This is my situation. I have a listbox (called list0) on a form (called frmDeleteClientContact). The listbox displays a list of clients by Lastname and Firstname from table tblClient. tblClient contains other fields but they are not relevent as all i need is Lastname and Firstname for the query. This is my row source for the listbox:
SELECT tblClient.ClientID, tblClient.LastName, tblClient.FirstName FROM tblClient ORDER BY [LastName];
So the listbox displays data like this from tblClient:
Lastname Firstname. Eg. Littlewood Rob.
I am creating a Delete action query that has all the fields from tblClient in it. I want the fields Lastname and Firstname to hold the criteria for the query. So when a client is selected in the listbox (list0) the lastname in the listbox is the criteria for Lastname and the firstname in the listbox is the criteria for Firstname if you understand me. So then when the query is run it deletes the selected record in the tblClient and the listbox is updated so the deleted client is no longer displayed. I can get the delete query working if i put [Please Enter Surname of client to delete:] into the criteria of the Lastname field. But i want it so it runs through a form and both the Firstname & Lastname is selected from the listbox.
I really am stuck,
Any help would be greatly appriciated.
Thanks
Jim