Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / March 2006

Tip: Looking for answers? Try searching our database.

Results from Query using IsSelectVar to a Table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Angeline - 30 Mar 2006 01:24 GMT
Hello,
I have a form which comprises of a multi-select List Box bound to a table
and a sub-form bound to a query. When the user selects in the list box the
results of the query appear in the subform (very useful thanks Duane Hookom).

The problem that I have is that I need to be able to get the results into
either a table but ultimately into a report so that the user can print off
their results in a specific layout. However once the form is closed the query
is reset. Can someone please tell me this is possible and  provide some
direction as to how. The module code iwhich the query uses is below:

Function IsSelectedVar( _
       strFormName As String, _
       strListBoxName As String, _
       varValue As Variant) _
           As Boolean
   'strFormName is the name of the form
   'strListBoxName is the name of the listbox
   'varValue is the field to check against the listbox
   Dim lbo As ListBox
   Dim item As Variant
   If IsNumeric(varValue) Then
       varValue = Trim(Str(varValue))
   End If
   Set lbo = Forms(strFormName)(strListBoxName)
   For Each item In lbo.ItemsSelected
       If lbo.ItemData(item) = varValue Then
           IsSelectedVar = True
           Exit Function
       End If
   Next
End Function
Duane Hookom - 30 Mar 2006 02:46 GMT
You leave the form with the list box on it open. Use a query similar to the
subform query as the record source for your report.

Signature

Duane Hookom
MS Access MVP
--

> Hello,
> I have a form which comprises of a multi-select List Box bound to a table
[quoted text clipped - 30 lines]
>    Next
> End Function
Angeline - 30 Mar 2006 03:29 GMT
THANK YOU ONCE AGAIN !

I so appreciate your help and generosity!
Angeline

> You leave the form with the list box on it open. Use a query similar to the
> subform query as the record source for your report.
[quoted text clipped - 33 lines]
> >    Next
> > End Function
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.