473,387 Members | 1,517 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,387 software developers and data experts.

Creating Functions Modules

hi all

um, lets see, im a 4th year elementary school teacher in a large urban area, msaccess novice, new to this forum, who has been helped greatly by the pros here. i took a break from reading some articles they sent to me, made me a BLT sandwich and a big glass of homemade sun tea, relocated the cat who keeps falling into the <little> dent i make on my end of the couch, and read through about 30 of the threads here just to be nosy.

well, i was blown away by the depth and breadth of the questions these guys field, no pun intended haha. ive seen everything from my piddly little calculated control question to advanced sql troubleshooting, geographical mapping, loops, linked tables, relationships, NULL conundrums, all manner of runtime errors, encryption algorithms, multilingual dbs and everything in between. einstein move over!

so, being the little sneak that i am, i started copying and pasting some of those little gems into a table i have in one of my dbs called "tbl_MSAcessTipsandTricks" which of course then got me to thinking well maybe i should do an aggregate parse (my contribution to msaccess slang) and group these little jewels into modules. grampa says that if you find one penny on the ground theres probably another one close by since everybody has 2 cents they want to throw in.

so my question is is this a good idea for a novice to be thinking about so early when she is still figuring out how to join 2 tables properly? ill accept opinions from any of the great poobahs :)

cheers!
Jul 17 '18 #1
14 1324
twinnyfo
3,653 Expert Mod 2GB
It is always a good idea to keep a collection of things that you might consider useful, even if you have no current use for them. Just create an empty module, put
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
At the top of it and add your Functions/Subs. Just make sure all of them start with Public and not Private. This will allow you to acces them directly from your immediate window if you want to test them.

So, even though you have no need for finding out how many Tuesdays or Thursdays there are in a month, you can add a function like that to your module, and then, when you get asked a questions about days or weeks in months, you have something to look at and review and modify to suit your needs!
Jul 17 '18 #2
zmbd
5,501 Expert Mod 4TB
I'm with twinnyfo
I have a database in its 11th version that I have module after module
I name the modules after what type of content they may have in them
"ADOB_ConnectionExample"; "Email_Code"; "Encrypt_AES_CBC_File"; etc...
I also have several queries setup that I've found very useful over the years showing examples of Union Queries and Cross-Tab queries - one of my favorite comes from a thread here: Show numbers not used: Post #7 used for finding some missing values.

You might want to consider some sort of tagging scheme so that you can find the things you want in your tables...
Jul 17 '18 #3
PhilOfWalton
1,430 Expert 1GB
I attach an ancient DB, which I really ought to update (not created by me), and not all in VBA, but those functions not written in VBA are not difficult to change.

It contains 2700 odd code snippets, and I have used it quite frequently. It really used to be my bible until I cam across the experts on this website.

Unfortunately, the upload failed despite the Zip File only being 3.4Mb and allegedly we are allowed a 5Mb file, so, if anyone wants a copy, I will have to email it out privately.

So, as usual, my first sentence was a load of …

Phil
Jul 17 '18 #4
hi twinnyfo
yes, public! i would have forgotten. they need to be accessed globally. thanx
Jul 18 '18 #5
hi zmbd
yes, i was thinking of doing queries, more specifically sql, first. cant get around sql as an all purpose strategy. for me, a tagging scheme would come later once i get enough code. thanx

cheers!
Jul 18 '18 #6
hi philofwalton
thanx, i would very much appreciate a copy. unfortunately, i have hit my 3 email limit on the forum and dont feel comfortable giving an email address out publicly. maybe later ok?

cheers!
Jul 18 '18 #7
PhilOfWalton
1,430 Expert 1GB
Hi Molly,

Fine. Send me a private message when you're ready.

Phil
Jul 18 '18 #8
Nauticalgent
100 64KB
I have bought the FMS inc Total Access code book which installs itself as an Add-In to Access. Lots of great things in there but it is not for a novice who gets easily discouraged. Fortunalty, that only applies to half of me...

There IS a way to import your own code libraries but I have not found anyone who claims this as a worthwhile undertaking - instead they resort to Phil's concept. Also, although I have not really dedicated am real effort, but I have been unable to locate any "how-to" articles on this subject.

Edit: Found one, just had to ask Dr. Google a better question.
https://www.devhut.net/2017/11/14/ms...ary-databases/
Jul 18 '18 #9
Nauticalgent
100 64KB
Good afternoon Molly!

I know you didn't ask for this but I figured you might find it useful.

The link below is the first of 9 (I think) videos from Philipp Stiefel. He has named it the "Better VBA" series and it contains some of the best practices I have ever seen.

If you are wanting to get your hands dirty but are unsure of how to begin, this series is for you.

https://www.youtube.com/watch?v=PqIu0NY5ihI&t=8s

The intro music leaves a little to be desired but he IS German after all!

Philipp Stiefel is a huge contributor to the Access community and I believe he just earned his MVP award from Microsoft. Once you get through this first series the rest of this channel has some great stuff too...

Let me know what you think!

John
Jul 18 '18 #10
NeoPa
32,556 Expert Mod 16PB
Hi NauticalGent.

Some good ideas there. Luke Chung (FMS Inc) is another MVP for Access (or now technically Office Apps and Services within the updated structure). A very clever guy with lots of good software out there.

Philipp Stiefel, on the other hand, is possibly not an MVP at this time. I was discussing with Peter Doering just the other day how we're both now the only MVPs left in our own countries (UK & Germany) :-( You can always check using Find an MVP. I couldn't find Philipp anywhere. That's not to say that his resources aren't quality, of course. Thanks for the link.

Other video resources, though not necessarily just for new users, are My YouTube Channel and a longer video on Microsoft's Channel9 (Free Tools for Microsoft Access) which includes Crystal Long and myself discussing various free offerings when we were in Redmond (Annual MVP Summit) a few years back.

Molly:
so my question is is this a good idea for a novice to be thinking about so early when she is still figuring out how to join 2 tables properly?
Yes. A very good idea.

I've set myself up a database that contains various references - mostly Bytes.com references - that I often use to help me answer questions here. Many of the questions have been covered before so I grab a link (The database is designed to formulate the link for me with a visible description as well as the actual web address, and in the format required for links here on Bytes.com.) and include that in any reply.
Jul 18 '18 #11
hi Nauticalgent

you know yesterday when i read your post i thought aha thats for me so i downloaded a trial version, figured 15 days was enough time to check it out. yiiiiiikes! i remember once when i was a kid i got this horse to run inside the corral but when he came to the fence instead of jumping he stopped dead in his tracks and ole molly girl saw earth from a distance. they say the crash from my landing still echoes in the hills :) i suspect i would be rubbing my butt again if i tried to tackle this one, better wait til im oh say in my third set of false teeth heehee

cheers!
Jul 19 '18 #12
hi again nauticalgent

yup, just put it into my shopping bag to watch later today. i have the summer off from teaching and giamberto is still mumbling about me whiling away my days watching the breezes blow while he slaves over hot code, well poor baby, nyuk.

as for getting my hands dirty, i tossed the dove cleansing bar and hauled out the lava soap my second day on this forum. havent looked back though and its ok if hes german, turns out im part deutsch myself!

weidersehen!
Jul 19 '18 #13
hi neopa

re: your database. you know, i see pros as those who have accumulated many thin layers of wisdom over time, sort of like seasoning on a good cast iron skillet. never occurred to me that beneath all that polish you guys still roll up your sleeves and get 'er done. cant wait to see you in action! my respects :)
Jul 19 '18 #14
NeoPa
32,556 Expert Mod 16PB
Molly:
cant wait to see you in action!
Well, the second of those links includes me talking. Incidentally it also includes the Cystal Long whose music you liked. The first is my YouTube channel that just includes the work I'm showing with my voice explaining what's happening. I hope you enjoy them - even if some are too long to sit through comfortably.
Molly:
never occurred to me that beneath all that polish you guys still roll up your sleeves and get 'er done.
I guess most of us still earn our livings doing this stuff. How bad is that. My hobby is my living.
Jul 19 '18 #15

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

Similar topics

2
by: Adam T. Gautier | last post by:
Greetings, I am trying to create a python module for a series of class files that because of their size I have divided into multiple files. class Foo --> foo.py class Boo --> boo.py I have...
2
by: Salvatore | last post by:
Hello, Given an expression f = '2*x+3' from a user input I would like to do some sort of function userFunction(x): return f(x) is it possible with Javascript ?
4
by: Sergio | last post by:
Hi, I was trying to implement functions with data associted to it sequentialy, I tried the following way(below), but that does not comply with the compiler norms for C++ even though that's not any...
3
by: Mark Dexter | last post by:
Our application currently runs in Microsoft SQL Server and we are porting it over to Postgres. When we write enbedded SQL queries for SQL Server, we need to reference user-defined functions with...
13
by: Tony | last post by:
And that is probably very unclear - so let me explain. Please forgive me if I screw up the terminology (and let me know what the correct term would be): What I want to do is to create a library...
4
by: grant | last post by:
Well, I just downloaded SQL 2005 Express to have a play. Good old Bill says "up and running in 20 minutes" Well 5 hrs, 5 reboots and 4 full un-install and re-install later I have finally got it...
6
by: Mohammad Omer | last post by:
Hi, I tried to validate file path without calling file creating functions. Is it possible? How? Regards, -aims
1
by: kaens | last post by:
So, I have a class that has to retrieve some data from either xml or an sql database. This isn't a problem, but I was thinking "hey, it would be cool if I could just not define the functions for...
2
by: Jl_G_0 | last post by:
Hey all, got one question about creation of functions. I have a function that receives a sql string and a datagrid to populate. void populate(DataGrid grid, string sql){ ...... } Lets say I...
3
Kelicula
by: Kelicula | last post by:
This is NOT a complete OO perl tutorial However I thought it could be beneficial to explain some of the basic concepts, and allow some users to simplify the software design process. I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.