How to Create and Modify QueryDefs Programmatically in your MS Access Database

  Рет қаралды 5,162

Sean MacKenzie Data Engineering

Sean MacKenzie Data Engineering

Күн бұрын

Пікірлер: 15
@vladoz9299
@vladoz9299 Жыл бұрын
Do you have a video where the table name changes in a query definition? Say, the same query is used each year, but the table name contains the current year in its name.
@seanmackenziedataengineering
@seanmackenziedataengineering Жыл бұрын
Good question - this is very possible and in fact, I use this strategy in some situations. You can simply change the entire SQL for the query to use your new table using the methods in this video!
@vladoz9299
@vladoz9299 Жыл бұрын
@@seanmackenziedataengineering Yes but then I need to do string manipulation and not use the DAO engine to do it auto. more simply? We have many queries that generate a custom built tables row by row. Each of the queries need the new table name each year.
@seanmackenziedataengineering
@seanmackenziedataengineering Жыл бұрын
@@vladoz9299 When you set the SQL for a querydef, it is a DAO querydef, so you are using DAO for the query. Maybe as an alternative, you could just generate a new querydef each time, but this will create many objects. If the data is uniform, you could try putting it all into one big table with an extra column for "query name" or something like that. Then, just select the query/report name from a drop-down and it will filter using a single query.
@zoomingby
@zoomingby Жыл бұрын
FYI, any created querydef object (with a non-zero length name) is automatically appended to the querydefs collection.
@seanmackenziedataengineering
@seanmackenziedataengineering Жыл бұрын
Thanks for sharing!
@zoomingby
@zoomingby Жыл бұрын
@@seanmackenziedataengineering Quite welcome :) Lol, 1 down 1000 bits of information to make it an even exchange. Thanks for all you do. You've helped me immeasurably over the years.
@mahmoudbarrawi7092
@mahmoudbarrawi7092 2 жыл бұрын
excellent Sir
@seanmackenziedataengineering
@seanmackenziedataengineering 2 жыл бұрын
Many many thanks!
@mahmoudbarrawi7092
@mahmoudbarrawi7092 2 жыл бұрын
When I watch the program, I feel that you are capable because your style is easy and abstaining, and I learned a lot from you, and I follow all your series, and finally to you from God all the reward and from those who watch all the appreciation, admiration and gratitude
@seanmackenziedataengineering
@seanmackenziedataengineering 2 жыл бұрын
@@mahmoudbarrawi7092 Very much appreciated. I'm glad you find it useful!
@DataisKing
@DataisKing 2 жыл бұрын
I use QueryDefs to run SQL statements so that my database users can export from Excel by filtering dropdowns on forms
@seanmackenziedataengineering
@seanmackenziedataengineering 2 жыл бұрын
Cool technique!
@RungeCarl
@RungeCarl 2 жыл бұрын
Anyway you could post a sample ACCDB file to demonstrate this?
@seanmackenziedataengineering
@seanmackenziedataengineering 2 жыл бұрын
@@RungeCarl Now posted on mackenziemackenzie.com/downloads
How to Add Simple User-Level Security to Microsoft Access Databases
26:44
Computer Learning Zone
Рет қаралды 45 М.
Getting Started with MS Access Visual Basic for Applications - VBA Code-Behind and Modules
32:06
Sigma girl VS Sigma Error girl 2  #shorts #sigma
0:27
Jin and Hattie
Рет қаралды 124 МЛН
The Lost World: Living Room Edition
0:46
Daniel LaBelle
Рет қаралды 27 МЛН
Какой я клей? | CLEX #shorts
0:59
CLEX
Рет қаралды 1,9 МЛН
How to Add a Row Number to your Query in Microsoft Access
11:12
Sean MacKenzie Data Engineering
Рет қаралды 1,7 М.
An Introduction to Reports in Microsoft Access
24:37
Sean MacKenzie Data Engineering
Рет қаралды 23 М.
Access VBA | Working with Query Definitions
29:42
Sigma Coding
Рет қаралды 4,7 М.
How to Kick Users out of Your MS Access Database
19:19
Sean MacKenzie Data Engineering
Рет қаралды 11 М.
How to Extract Files from an Access Attachment with VBA
30:52
codekabinett.com/en
Рет қаралды 8 М.
How to set Access database expired
19:58
T Golden Eye
Рет қаралды 16 М.
Sigma girl VS Sigma Error girl 2  #shorts #sigma
0:27
Jin and Hattie
Рет қаралды 124 МЛН