Hi guys,
I have a list box with rowsource "QryListBox"
I have SortBy option buttons on my form that change the list box's rowsource depending on the selection made i.e.
This works great and gives the user a nice dynamic sort function.
Of course this isnt enough. Rather than printing a report they would like to define their criteria (i.e. use the normal search form) and then click a button to create an Excel Document.
I have looked at both the Transfer Text and Output to Functions but these only seem to work on fixed database objects such as the original query.
Can anyone push me in the right direction for creating a module that takes the list boxes current rowsource (query def) and exports that as an Excel document.
I know it is possible but havent done a lot with DAO (if thats what i need?)
Thanks
Ben
I have a list box with rowsource "QryListBox"
I have SortBy option buttons on my form that change the list box's rowsource depending on the selection made i.e.
Code:
strSQL = "SELECT " & Me.List.Rowsource & ".* FROM " & Me.ListBox.Rowsource " & " ORDER BY " & strOrderBy 'where strOrderBy is the field I wish to order my list box by
This works great and gives the user a nice dynamic sort function.
Of course this isnt enough. Rather than printing a report they would like to define their criteria (i.e. use the normal search form) and then click a button to create an Excel Document.
I have looked at both the Transfer Text and Output to Functions but these only seem to work on fixed database objects such as the original query.
Can anyone push me in the right direction for creating a module that takes the list boxes current rowsource (query def) and exports that as an Excel document.
I know it is possible but havent done a lot with DAO (if thats what i need?)
Thanks
Ben