473,387 Members | 1,464 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.

Conditional VBA programming

Hi all, thanks for reading!

First of all I have no experience with VBA at all... I don't want to try and learn if it won't accomplish what I need. So here's my question:

I'm creating a client database for a nonprofit org. The data is just demographics for grant reporting...

Is it possible to do a code that determines whether a client is below the poverty line based on two separate fields [income(which will be a range, not a specific $ amount) and family size]? Also the poverty line obviously will change every year, will that be a problem?

If this is possible, could someone point me in the general direction??

Thank you so much for your time,

Katie
Jun 28 '08 #1
3 1655
nico5038
3,080 Expert 2GB
No real code is needed for a case like this.
Best to store the poverty line value in a separate table.
Now link the persons table to this table and specify the conditions like:

select name, income from tblPerson as A INNER JOIN tblPovertyLine as B ON (A.Income between B.Bottomine and B.TopLine and A.familyno equal B.FamilyNumber)

The INNER JOIN can be used to specify the conditions as you need them. Just make sure the proper fields are used.

Getting the idea ?

Nic;o)
Jun 28 '08 #2
youmike
69
A couple of general thoughts:

1. What Nico5038 offered is not VBA coding, but SQL. If you find trying to write correct SQL takes more time than you have, it is nearly always possible to construct a query to do the job using the query grid. I'd say you could do it in this case. Using the grid is almost always quicker and if, having used the grid, you find that you need to edit the underlying code, it can be seen using the SQL view of the query. It's a good way to learn SQL, which like all computer programming languages has very tight rules. If you do change code, Access checks what you've done and highlights mistakes.

2. Regarding VBA, the bottom line is that it can achieve pretty much anything you'll ever need - you just have to learn how to use it. If you have to make significant use of Access, you'll find yourself drawn down this route, because apart from the "do anything" factor, embedded VBA coding is actually easier to maintain I think, and the nature of your projects is likely to make them get more complex as time goes by - to satisfy the needs of your users. For these reasons, I'd say that learning VBA will reply the time spent in the long term.
Jun 29 '08 #3
ADezii
8,834 Expert 8TB
How about posting some data displaying Income Ranges and Family Sizes that would qualify individuals who would be classified at the Poverty Level?
Jun 29 '08 #4

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

Similar topics

11
by: Steven T. Hatton | last post by:
I've made no secret of the fact that I really dislike the C preprocessor in C++. No aspect of the language has caused me more trouble. No aspect of the language has cause more code I've read to be...
62
by: Reinhold Birkenfeld | last post by:
Hi, after Guido's pronouncement yesterday, in one of the next versions of Python there will be a conditional expression with the following syntax: X if C else Y which is the same as today's...
13
by: Andrew | last post by:
I use conditional compiler constants, set through the VBA IDE in Tools, <projectname> Properties, that I refer to throughout my code to control which code is used during development, and which...
92
by: Raghavendra R A V, CSS India | last post by:
hie.. Do any one knows how to write a C program without using the conditional statements if, for, while, do, switch, goto and even condotional statements ? It would be a great help for me if...
8
by: Olov Johansson | last post by:
I just found out that JavaScript 1.5 (I tested this with Firefox 1.0.7 and Konqueror 3.5) has support not only for standard function definitions, function expressions (lambdas) and Function...
44
by: petermichaux | last post by:
Hi, I have been using the following line of code to create an object called "Serious" if it doesn't already exist. if (Serious == null) {var Serious = {};} This works in the scripts I use...
43
by: dev_cool | last post by:
Hello friends, I'm a beginner in C programming. One of my friends asked me to write a program in C.The purpose of the program is print 1 to n without any conditional statement, loop or jump. ...
15
by: Dan Henry | last post by:
I have run across functions in the Linux kernel's MTD driver that have me scratching my head a bit. The functions have the general form: extern int bar(size_t len, size_t *retlen, unsigned char...
16
by: Alan Jones | last post by:
Hello everyone, any help would be greatly appreciated. :) What I'm trying to do may not be advisable, but here goes... I want a page named signature.php to appear conditionally as an include...
4
by: Zack | last post by:
Hi, Let's say you have this function named validate. validate looks like this: function validate() { return ($F("Email") != '' ? ($("Name").value = $F("Email")) : false); }
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.