473,503 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with code??

8 New Member
Hi. I am trying to make a cashbook in Access for my fathers business.. I am new to Access and Bytes. I made a table with the following fields: ID (primary key), Supplier, Date, Invoice Number, Details, Zero Rated (this is a check box with a yes/no data type), Amount, VAT. I highlighted the VAT column in design view and went to default value and put this in

Expand|Select|Wrap|Line Numbers
  1. IF([Zero Rated]=0,[Amount]*0.14,0)
BTW the name of the table is Purchases. I am getting errors with this formula though. Please help me where I am going wrong and also tell me what I am doing wrong.. I am keen to learn Access. :)

dayav07
Jan 19 '10 #1
3 1333
nico5038
3,080 Recognized Expert Specialist
If it's in the form field try:
Expand|Select|Wrap|Line Numbers
  1. =IIF([Zero Rated]=0,[Amount]*0.14,0)
  2.  
Personally I would use a separate TaxRate table and get the % from there for the calculation.

Nic;o)
Jan 19 '10 #2
dayav07
8 New Member
Hey man.. I tried that and it works but then in the form if i put in 10 in the amount the vat will show 1.4 but then when i press enter to record it it doesnt appear in the VAT column in the table..

any ideas?
Jan 20 '10 #3
nico5038
3,080 Recognized Expert Specialist
A field holding an "=" is by definition "Unbound", and thus not stored.
Due to the normalization rules we normally don't store results of an algoritm, but apply it when needed on the "basic" data. Thus when the basics change the result will still be "in line".
The same IIF() can be used in a query, thus actively creating the column when needed.

Getting the idea ?

Nic;o)
Jan 20 '10 #4

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

Similar topics

4
2740
by: PHPkemon | last post by:
Hi there, A few weeks ago I made a post and got an answer which seemed very logical. Here's part of the post: PHPkemon wrote: > I think I've figured out how to do the main things like...
6
2983
by: d.warnermurray | last post by:
I am doing a project for school that involves creating help files for a html authoring tool. If you could help me with answers to some questions it would really help. 1. What tasks do you expect...
6
391
by: Mark Reed | last post by:
Hi all, I am trying to learn a little about programming (I know next to nothing so far) and have found some code which hides the toolbars. However, this bit of code is a little too effective and...
4
2602
by: dixie | last post by:
Help, I'm really out of my depth here (not unusual I hear you say :-). I have just installed HTML Help in an application. I told it in the Project Properties the path to the help file. I then...
7
3287
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte...
23
3232
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
16
1989
by: Allen | last post by:
I have a class that returns an arraylist. How do I fill a list box from what is returned? It returns customers which is a arraylist but I cant seem to get the stuff to fill a list box. I just...
3
3720
by: inkexit | last post by:
I need help figuring out what is wrong with my code. I posted here a few weeks ago with some code about creating self similar melodies in music. The coding style I'm being taught is apparently a...
1
2275
by: glenn123 | last post by:
Hi, i am just about out of time to produce a working jukebox which has to perform these functions: to play music files when a track is chosen from a list which when the user presses the change genre...
10
3327
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably...
0
7076
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
7274
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
7323
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...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5005
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.