irunergoiam
Registered User.
- Local time
- Today, 12:06
- Joined
- May 30, 2009
- Messages
- 76
I have a list box on a form that displays two columns (Path and Mapping) for Shared Folders assigned to a person. These columns come from a query based on three criteria of the form (1. Location; 2. Department; 3. Position) that are not displayed in the query (or for that matter, the list box).
I would like to have the user select a row from the list box and click a button to delete that row from the original table on which the query and list box are based.
I found a pretty good starting point at http://www.databasedev.co.uk/query_using_listbox.html, but am not quite sure how to go about this as I do not wish to use a union query and have an "All" selection option available.
I've made modifications to that code and used tick marks to skip the following:
'Dim flgSelectAll As Boolean
'If "All" was selected in the listbox, don't add the WHERE condition
'If Not flgSelectAll Then
'strSQL = strSQL & strWhere
'End If
I get a compile error "Sub or Function Not Defined" at
Exit_cmdOpenQuery_Click: (just below "Next VarItem")
So, two questions: 1) Is this even the right approach or 2) Is there a better way to select a row from a list box and delete it?
Much thanks to the AWF masters who mentor the barely-initiated like me!
I would like to have the user select a row from the list box and click a button to delete that row from the original table on which the query and list box are based.
I found a pretty good starting point at http://www.databasedev.co.uk/query_using_listbox.html, but am not quite sure how to go about this as I do not wish to use a union query and have an "All" selection option available.
I've made modifications to that code and used tick marks to skip the following:
'Dim flgSelectAll As Boolean
'If "All" was selected in the listbox, don't add the WHERE condition
'If Not flgSelectAll Then
'strSQL = strSQL & strWhere
'End If
I get a compile error "Sub or Function Not Defined" at
Exit_cmdOpenQuery_Click: (just below "Next VarItem")
So, two questions: 1) Is this even the right approach or 2) Is there a better way to select a row from a list box and delete it?
Much thanks to the AWF masters who mentor the barely-initiated like me!