473,657 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

URGENT: Numeric Calculations in Access - Access n00b Question

URGENT

I have an assignment to hand in tomorrow, I need to know how to perform
numeric calculations in access, I dont know very much about databases
so consider this a beginner's query!

Well basically this is what I'm aiming at, its nothing too complicated
really.

I have a table called RESOURCES which keeps track of all of the stock
the company has (e.g. how much paper, how many mugs, tshirts etc.). I
want the database to be able to automatically take 1 away from the
selected resource when a form is used to file a new order.

E.g.

I have a form asking me the details of the design, In the resources
table I have set the quantity of mugs as 100, i.e. I have 100 mugs in
stock and available.

I use the form and tell the database that I am making a design which
will use 1 mug.

The database then goes to the resource table and takes 1 away from the
available stock of mugs making the total mugs available 99.

I then the database to be able to do this automatically, when a
checkbox is ticked, when the form is submitted I want it to see which
text boxes are ticked and take the correct consequent resources from
the RESOURCE table.

I have Access 2003, I have attached the file incase anyone needs it,
note that the Forms have NOT been made only the resource, customers and
orders tables have been created.

If someone could tell me how to do this I'd be extremely greatful, this
is very URGENT I have to hand in the project on Monday!!!

I know I'm asking alot but I'd be really really greatful if someone
could help me out!!!

Cheers,

//Xeijin

Mar 26 '06 #1
2 1815
Xeijin wrote:
URGENT

I have an assignment to hand in tomorrow, I need to know how to perform
numeric calculations in access, I dont know very much about databases
so consider this a beginner's query!

Well basically this is what I'm aiming at, its nothing too complicated
really.

I have a table called RESOURCES which keeps track of all of the stock
the company has (e.g. how much paper, how many mugs, tshirts etc.). I
want the database to be able to automatically take 1 away from the
selected resource when a form is used to file a new order.

E.g.

I have a form asking me the details of the design, In the resources
table I have set the quantity of mugs as 100, i.e. I have 100 mugs in
stock and available.

I use the form and tell the database that I am making a design which
will use 1 mug.

The database then goes to the resource table and takes 1 away from the
available stock of mugs making the total mugs available 99.

I then the database to be able to do this automatically, when a
checkbox is ticked, when the form is submitted I want it to see which
text boxes are ticked and take the correct consequent resources from
the RESOURCE table.

I have Access 2003, I have attached the file incase anyone needs it,
note that the Forms have NOT been made only the resource, customers and
orders tables have been created.

If someone could tell me how to do this I'd be extremely greatful, this
is very URGENT I have to hand in the project on Monday!!!

I know I'm asking alot but I'd be really really greatful if someone
could help me out!!!

Cheers,

//Xeijin

I haven't a clue about your checkbox names, the text field names, etc.

Let's say you have on your form a textbox called Qty that displays the
current Qty on hand. You have another text box called QtyUsed that
indicates the number of mugs to use.

You could create a SQL statement similar to
If msgbox "Are you sure you want to update the Qty On Hand?", _
vbYesNo,"Confir m TableUpdate) = vbYes Then

strSQL = "UPDATE TableName " & _
"SET TableName.Qty = " & _
"[TableName].[Qty] - " & Me.QtyUsed & " " & _
"WHERE TableName.ID = " & Me.ID
Currentdb.Exect ute strSQL
Endif

Is your form static as far as the items to be listed/updated? For
example are there tic boxes for each item to be used? Then you can use
a bunch of if/endifs

If Me.CheckMug = True then
strSQL = "UPDATE TableName " & _
"SET TableName.Qty = " & _
"[TableName].[Qty] - " & Me.QtyUsed & " " & _
"WHERE TableName.ID = " & Me.CheckMugID
Currentdb.Exect ute strSQL
Endif

If Me.CheckShirt = True then
strSQL = "UPDATE TableName " & _
"SET TableName.Qty = " & _
"[TableName].[Qty] - " & Me.QtyUsed & " " & _
"WHERE TableName.ID = " & Me.CheckShirtID
Currentdb.Exect ute strSQL
Endif
etc
Mar 26 '06 #2
Br
Xeijin wrote:
URGENT

I have an assignment to hand in tomorrow,
Left it a bit late haven't you?

Personally I don't think this forum is for people to do your homework for
you.....

<>
... I have attached the file incase anyone needs it,


Do not attach files unless you are posting to a binaries group.

<>
--
regards,

Br@dley
Mar 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6375
by: Edwinah63 | last post by:
Hi Everyone, All the very best for 2004!! i need urgent help with this problem, the users are about to skin me alive!! we have an access front end with linked to sql server 2k tables. when a user tries to insert a record into one of the tables it
30
3670
by: Dr John Stockton | last post by:
It has appeared that ancient sources give a method for Numeric Date Validation that involves numerous tests to determine month length; versions are often posted by incomers here. That sort of code seems unnecessarily long. For some while, the following approach has been given here :- function ValidDate(y, m, d) { // m = 0..11 ; y m d integers, y!=0
1
1446
by: mmuriegas | last post by:
Numeric data is imported as integer's. Loss of the fractions throws the calculations off. I am following the trail of a previous programmer and found that he was impoting a file "import delimited", all fields are text. I need to import the file defining some of the fields as numeric? What do you recommend as the simpliest, best way to do this?
2
8670
by: Robert McEuen | last post by:
Using Access 97, Windows XP I'm receiving a Numeric Field Overflow error during text import that I did not receive before I split my database. Another thread I found suggested that the cause of this error might be due to columns on the text file being in a different order than fields in the destination table, but they're the same in my case. I'm thinking a workaround might be to import to a temp table in the front-end, run an append...
1
1064
by: David | last post by:
...i got this error: quote: ------------------------------------------------------------------------------ Access to the path "c:\inetpub\wwwroot\NewsServer\DBRelations\NewsServerBase.xml" is denied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
0
1686
by: lletsweletse | last post by:
I have books and i have enter them into my database using microsoft access. Entities are:Vendor,Book Title,Quantity and price Student entities:Name,Book title,Book price,Quantity issued,Total allowance When the book issued to the student i want the quantity to be reducted from the system for book entered.Students are given P2000.00 for book allowance,i want the system to be like this,when entering the book price to reduct the amount...
2
2139
by: Earl G via AccessMonster.com | last post by:
I have tried. But now I ask. I cannot get a control to accept a numeric entry (e.g. 0.23) without first entering a zero. I want to allow only two decimal places. But I would like numbers less than 1 to be enter by pressing the decimal then one or two digits. This is a normal entry method in Excel and Foxpro, etc.. Any help would be appreciated. Thanks in advance. -- Message posted via AccessMonster.com
1
1563
by: Grubsy4u | last post by:
Grubsy4u Newbie 7 Posts October 5th, 2007 11:31 AM #1 Report calculations --------------------------------------------------------------------------------
0
1180
by: Charles Calvert | last post by:
On Sun, 12 Oct 2008 15:01:10 -0400, sheldonlg <sheldonlgwrote in <7bydneRJ1oMS1G_VnZ2dnUVZ_vSdnZ2d@giganews.com>: "SELECT *" is a bad habit. Since he wants those two fields only, it should be "SELECT FSR, Password FROM tablename WHERE FSR = $FSR AND Password = '$Password'". Note that I'm assuming that FSR is a numeric field here. If not, it should also be surrounded by single quotation marks. Reasons:
0
8402
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8315
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8829
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8734
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8508
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7341
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4323
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2733
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 we have to send another system

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.