Thanks Pavel!!!
It works perfectly.
Now I have another question. this one is quite complicated but I will
see if I can explain.
I have two textboxes on my contacts form which are unbound. The first of
these is a list of products which the current contact is interested in
and the second listbox is a description of the product that is currently
selected in the first listbox. When I press the insert key on the
products listbox, another form pops up which allows me to select all the
products which the current contact is interested in. I then click a
button on the form and the selected products are transferred to the
first listbox on the contacts form via an SQL statement. then if I
select any of these newly added products, the proper description is
displayed. The problem comes when I try to delete any of the products
from the contact. The problem is that the second listbox gets its data
from a different table than the first listbox and I use the column
property to populate the second listbox. when I delete a product, the
product description is not deleted but I do not want it to be because
the description comes from the products table itself, whereas the
products are added to an Add Products to Contacts table. I hope this
makes sense.
here is the query that populates the first listbox.
---
SELECT [Products by Contact Query].ContactID, [Products by Contact
Query].ProductID, [Products by Contact Query].ProductName,
Products.ProductDescription FROM [Products by Contact Query] INNER JOIN
Products ON [Products by Contact Query].ProductID=Products.ProductID;
----
and here is the code that provides the description of the selected
product.
Private Sub LstContactProducts_AfterUpdate()
txtProductDescription.SetFocus
txtProductDescription.Value = LstContactProducts.Column(3,
LstContactProducts.ItemsSelected)
LstContactProducts.SetFocus
End Sub
My question is simply this:
how do I delete the product description from the product given that the
list boxes are populated from two different source tables? I cannot
delete the product description directly as it is part of the Products
table and not part of the Add Products to Contacts table.
I hope this makes sense!!!
Thanks for all your all help Pavel
Colin
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!