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

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 1808
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,"Confirm TableUpdate) = vbYes Then

strSQL = "UPDATE TableName " & _
"SET TableName.Qty = " & _
"[TableName].[Qty] - " & Me.QtyUsed & " " & _
"WHERE TableName.ID = " & Me.ID
Currentdb.Exectute 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.Exectute strSQL
Endif

If Me.CheckShirt = True then
strSQL = "UPDATE TableName " & _
"SET TableName.Qty = " & _
"[TableName].[Qty] - " & Me.QtyUsed & " " & _
"WHERE TableName.ID = " & Me.CheckShirtID
Currentdb.Exectute 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
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. ...
30
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...
1
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",...
2
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...
1
by: David | last post by:
...i got this error: quote: ------------------------------------------------------------------------------ Access to the path "c:\inetpub\wwwroot\NewsServer\DBRelations\NewsServerBase.xml" is...
0
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...
2
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...
1
by: Grubsy4u | last post by:
Grubsy4u Newbie 7 Posts October 5th, 2007 11:31 AM #1 Report calculations --------------------------------------------------------------------------------
0
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...
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...
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
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
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
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...

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.