Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filtering in a compiled executible program

Status
Not open for further replies.

abacus9

Programmer
Jan 14, 2000
4
US
&quot;Filter by form&quot; is disengaged when the Access program is compiled for distribution. I was told that I would need to write VB code to simulate the &quot;filter by form&quot; function. I have a form with 22 fields. The user can filter on any combination of these fields. I would like to distribute the program so the user does not have to have Microsoft Access on his/her computer. However, I need to provide the filtering capability.<br>
<br>
Does anyone have code that simulates the &quot;filter by form&quot; process, which creates a query with only those fileds and criteria selected.<br>
<br>
Thanks<br>

 
Dim db as database, rst as recordset<br>
Set db = opendatabase(&quot;C:\Mydb&quot;)<br>
SQL = &quot;Select myfield1, myfield2, From MyTable Where myfield1 = &quot; & Me!TextBoxtoSearch<br>
Set rst = db.openrecordset(SQL)<br>
Me![SubformName].form.Recordsource = SQL<br>
<br>
Now the easist way to build s SQL statement is to go in Access Link or what ever all your tables create a query which works<br>
then click SQL view and cut & paste the SQL code in above where SQL = <br>
<br>
hope this helps<br>
<br>
<br>
<br>
<br>
' I like to use a sub form and set it to Datasheet view.<br>
<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top