Well yeah.<br>Uh what kind of list?<br>A form <br>A Table<br>A Query<br>A report<br>A listbox on a form.<br><br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
The ListBox itself does not provide any support for deleting data from the tables in it's RecordSource, but you can certainly write code yourself to do this.<br><br>Assuming a listbox called MyList, which displays the primary key (MyKey) from table MyTable and a button on the form named MyDelButton...<br><br><FONT FACE=monospace><br>Sub MyDelButton_Click()<br><br> DoCmd.RunSQL "Delete From MyTable Where MyKey = " & Me!MyList<br> <br> MyList.Requery<br><br>End Sub<br></font><br><br>If MyKey is a text field, change the code above to enclose Me!MyList in single quotes...<br><br>... Where MyKey = <font color=red><b>'</b></font>" & Me!MyList & "<font color=red><b>'</b></font>" <br> <p>Jim Conrad<br><a href=mailto:jconrad3@visteon.com>jconrad3@visteon.com</a><br><a href= > </a><br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.