Creating a filter by Form??
Creating a filter by Form??
Creating a filter by Form??
Creating a filter by Form??
Creating a filter by Form??
Creating a filter by Form?? Creating a filter by Form?? Creating a filter by Form?? Creating a filter by Form?? Creating a filter by Form?? Creating a filter by Form?? Creating a filter by Form?? Creating a filter by Form??
Creating a filter by Form?? Creating a filter by Form??
Creating a filter by Form??
Go Back  Xtreme Visual Basic Talk > > > Creating a filter by Form??


Reply
 
Thread Tools Display Modes
  #1  
Old 01-20-2003, 08:51 PM
john_mcdowell
Guest
 
Posts: n/a
Default Creating a filter by Form??


As part of the application I am creating, I need to have a pop-up form for the purpose of gathering selection criteria to then built an SQL stmt from the user's selections and let control return to the main form.

Possibly create a global variable (defined in a standard module) to hold the created SQL, and when control returns to the main form, it just retrieves the SQL from that variable. If that variable is "", then the user would have cancelled out.

I am already using an OptionGroup control in the main form to filter the recordset and fill the list in a "final selection" combo box... the code is as follows:

If (CompanyNameFilters = 1) Then
' Filter for company names that start with A, └, ┴, ┬, ├, or ─.
DoCmd.ApplyFilter "", "[CompanyName] Like ""[A└┴┬├─]*"""
' Creates a selection list in the cboCompanyName combo box for filtered records
Me!cboCompanyName.RowSource = "SELECT Contacts.CompanyName FROM Contacts WHERE (((Contacts.CompanyName) Like '[A└┴┬├─]*')) ORDER BY Contacts.CompanyName;"

End If

My questions are:
1. How would I reconstruct the code where the ApplyFilter statement gets its value from the standard module variable and how do I have the OptionGroup selection alter that variable as well(whichever takes precedent... a) if a OptionGroup button is pressed OR b) a form filter set of criteria is used). I could use a little help on writing code for the variable!
2. I assume the Form for querying the table(s) would have a "run query" cmd button which would create the criteria statement, Apply the filter to the main form, fill the list in the combo box and pass control back to the main form... How do you suggest I do that? I haven't used Pop-Up Forms before thus passing control back to the main form is a bit vague to me! If you have an example I would appreciate it as well.. regardless I am grateful for the help.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Creating a filter by Form??
Creating a filter by Form??
Creating a filter by Form?? Creating a filter by Form??
Creating a filter by Form??
Creating a filter by Form??
Creating a filter by Form?? Creating a filter by Form?? Creating a filter by Form?? Creating a filter by Form?? Creating a filter by Form?? Creating a filter by Form?? Creating a filter by Form??
Creating a filter by Form??
Creating a filter by Form??
 
Creating a filter by Form??
Creating a filter by Form??
 
-->