473,407 Members | 2,306 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,407 software developers and data experts.

Payroll database

Wow!!! Thank you all who support me a lot to change an ideal one in to real Database.
One more question,In my database I have fields called [status] and [Basic Salary].

If [Status] = No, meaning eligible for pension deduction.
So, Pension: [Basic salary]*0.07
Else,
[Status] = Yes, meaning not eligible.
Pension: 0
Therefore I need an expression which executes it.
With regards!!!
Aug 22 '14 #1

✓ answered by twinnyfo

Samuel,

It appears you essentially have your code:

Expand|Select|Wrap|Line Numbers
  1. If Not [Status] Then
  2.     Me.txtPension = [txtBasic salary] * 0.07
  3. Else
  4.     Me.txtPension = 0
  5. End If
I am not sure what else you would need on this one....

Of course, mods need to be made to match the controls on your form....

4 1137
twinnyfo
3,653 Expert Mod 2GB
Samuel,

It appears you essentially have your code:

Expand|Select|Wrap|Line Numbers
  1. If Not [Status] Then
  2.     Me.txtPension = [txtBasic salary] * 0.07
  3. Else
  4.     Me.txtPension = 0
  5. End If
I am not sure what else you would need on this one....

Of course, mods need to be made to match the controls on your form....
Aug 22 '14 #2
Seth Schrock
2,965 Expert 2GB
Therefore I need an expression which executes it.
How it executes it totally up to you. If you want it to run when you click a button, then you would put it in a button's On_Click event. If you want it to be automatic, then I would put it in a public function and then call the function as part of the form's recordsource. There are lots more options as well. What do you want to happen?
Aug 22 '14 #3
NeoPa
32,556 Expert Mod 16PB
Twinnyfo has it about right as for the logic. Maybe a simpler version :
Expand|Select|Wrap|Line Numbers
  1. With Me
  2.     .txtPension = IIf([Status], 0, .txtBasicSalary * 0.07)
  3. End With
Aug 22 '14 #4
Thanks all! Your suggestion helps me a lot.

Thanks I got the answer.
Aug 24 '14 #5

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

Similar topics

0
by: Cherrish Vaidiyan | last post by:
sir, The following are the steps that i followed in setting up standby database on Red hat Linux 9. i am using Oracle 9i. i have followed the steps in this site : ...
346
by: rkusenet | last post by:
http://biz.yahoo.com/rc/040526/tech_database_marketshare_1.html Interesting to see that database sales for windows is more than Unix.
1
by: cheungs7 | last post by:
Hi all, Wondering whether you can anyone help me. We have Sage Payroll (and accounting/payroll software), which has a MS Access database where the data is stored. Now I want to access the...
4
by: Mark T. | last post by:
Hi all, New to Access...... Trying to create a payroll database for employees who are paid on the 1st and the 15th of the month. This is quite different than every 2 week pay periods. ...
1
by: Akinyemi | last post by:
I am developing a payroll program.. The data generated will be saved in an Access Database. I want a situation whereby when an employee leaves the organization or retires, instead of deleting his...
8
by: John Sitka | last post by:
Hi, There are four pay types standard shiftpremium doubletime doubletimepremium each hour a person books can be one of these types
1
by: Tlholo | last post by:
Here are the requirements for the project. I have also included the other project that I am working on and is also giving me some problems. i need code examples. Project 1 This program actually...
7
by: bhipwell via AccessMonster.com | last post by:
Hello, I have developed an employee benefits database that currently contains over 3000 employees and 70+ companies. Having started the database as a really simple solution for our clients, the...
2
by: alexlunar | last post by:
Hello, I am trying to figure out when I have done wrong or what i have not included in my most recent edit of my payroll code. My code from last week was // Week 2 payroll // payroll program...
9
by: dougancil | last post by:
have an application that I'm trying to finish in VBA, and as I've never written in it, it's a bit challenging to me. I've written some in VB but the syntax isn't the same between the two for some...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.