473,322 Members | 1,614 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Filter table from VB Code

ChaseCox
294 100+
Is there a way to filter tables in a Database with only VB Code, or do you have to use the queries? If this is possible I would like to eliminate my queries and filter the tables in my database with just code. I would also like the results to be output to a new table in the database and maybe to an excel file. I have no idea how this would work, so I will need alot of help if this is possible. I would like to use my form to still pass the values in.
Feb 8 '07 #1
2 7764
nico5038
3,080 Expert 2GB
Basically You need a query with criteria to filter a table.
Changing such a query into a MakeTable query will create a filtered copy.

Filtering from code is done on a form, e.g. a master form with a datasheet subform.
There the right-click (also usable on a table) can be used to filter with an AND relation, or the FilterByForm button when an OR relation is needed.
In code you can also apply a filter with:

Me.subformname.form.filter = "ID=" & me.ID
Me.subformname.form.filteron = True

Such a filter (and a right-click filter) can be added as a WHERE clause to a query created in code.

Nic;o)
Feb 8 '07 #2
NeoPa
32,556 Expert Mod 16PB
Is there a way to filter tables in a Database with only VB Code, or do you have to use the queries? If this is possible I would like to eliminate my queries and filter the tables in my database with just code. I would also like the results to be output to a new table in the database and maybe to an excel file. I have no idea how this would work, so I will need alot of help if this is possible. I would like to use my form to still pass the values in.
Although you could implement a sort of filtering in VB code it would not serve your purpose well. The result would only be available to your code for a start, which would need to be developed further to output the results somewhere accessible. It really has many drawbacks, not least of which is the inefficient execution.
I'm curious as to why you would want to bypass one of the (possibly the most) fundamental tools of database manipulation and processing?
Feb 10 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: foldface | last post by:
Hi This works but is a bit long-winded. Is there a better way? ta F <style> ..Header { background-color: gray;
0
by: Tom Young | last post by:
CCIDE reads your C program source and expands decision tables with supporting C code. See http://sourceforge.net/projects/ccide for downloads and more. See the CCIDE Home Page at...
1
by: Benny Raymond | last post by:
I have a dataset setup with a main table that has some information in it along with an element that is a nested table so that I can store rows of history information for that one row in the main...
5
by: Michael C via AccessMonster.com | last post by:
Hello, I have a table that I am appending 3 seperate tables into. My main problem is that each time I append the data, it simply adds to the data already there. That might sound ok, except that...
2
by: The_Monkey | last post by:
I have created a form with a combo box to filter a subform using a date. The filter works great but not with dates starting with a 0 e.g 01/07/2006 I have set the format to short date for the...
3
by: turtle | last post by:
I have Two tables (Table1 and Table2). Both tables have a common field called part number. Table 1 contains an extra field that i would like to update table 2 to match if the part number matches....
27
stonward
by: stonward | last post by:
Hi again People. This Forum has been a serious help for me...I'm sure you know how it is...you get pretty good at handling Access when wham! you come across something you just can't figure - and...
0
by: Romulo NF | last post by:
Greetings again everyone Recently i´ve been asked to develop a script to allow filtering in the content of the table, with dinamic options based on the own content. Example: a table with the name of...
0
by: agiler | last post by:
help,a regular text file how to sql 2000 table code ? i have a text file as follow, line with ˇ°|ˇ±and {LF}, 8|-000000186075919.|+000000000387820.|2008-03-31|20010423|...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.