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

Entering A Transaction

I have a transactions table with a field named Transaction. I want Transaction
to be positive for input and negative for outflow. How do I set up the form for
entering outflow so for data entry, the value is entered as a positive number,
is stored as a negative number and when the form is opened to the same record it
displays a a positive number. Is the form based on a query and if so what does
the Transaction field in the query look like?

Thanks!

Rose
Nov 13 '05 #1
2 1567
A very simple way to do this is to add another field called (say) Multipler,
type Number, size Long Integer, Required, Validation Rule:
1 or -1

Add a text box to both forms. On one form, set the text box's Default Value
to 1, and on the other form -1. You can set the Visible property to No on
both forms, but the Default Value ensures that right value is assigned when
new records are entered into the form.

The RecordSource for both forms is a query statement:
SELECT * FROM MyTable WHERE Multipler = 1;
SELECT * FROM MyTable WHERE Multipler = -1;
and that loads the desired records into each form.

You can now sum the Amount field like this:
Sum([Multipler] * [Amount])
to get the desired result.

A side-effect of this design is that it is actually possible to put a
reversal entry through, i.e. you can use a negative Amount in either form.
In some designs that's very desirable; if you don't want that to occur, use
a Validation Rule on the Amount field of:
=0
There are other ways to approach this issue. For example, you can make a
text box default to negative by examining its Text property in its
AfterUpdate event, and if the first character is not a sign ("+" or "-")
then negate its value.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Rose" <ro*******@earyhlonk.net> wrote in message
news:Mw*****************@newsread2.news.atl.earthl ink.net... I have a transactions table with a field named Transaction. I want Transaction to be positive for input and negative for outflow. How do I set up the form for entering outflow so for data entry, the value is entered as a positive number, is stored as a negative number and when the form is opened to the same record it displays a a positive number. Is the form based on a query and if so what does the Transaction field in the query look like?

Thanks!

Rose

Nov 13 '05 #2
Allen,

Thanks for the prompt response! Works perfect!

Rose
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:40**********************@per-qv1-newsreader-01.iinet.net.au...
A very simple way to do this is to add another field called (say) Multipler,
type Number, size Long Integer, Required, Validation Rule:
1 or -1

Add a text box to both forms. On one form, set the text box's Default Value
to 1, and on the other form -1. You can set the Visible property to No on
both forms, but the Default Value ensures that right value is assigned when
new records are entered into the form.

The RecordSource for both forms is a query statement:
SELECT * FROM MyTable WHERE Multipler = 1;
SELECT * FROM MyTable WHERE Multipler = -1;
and that loads the desired records into each form.

You can now sum the Amount field like this:
Sum([Multipler] * [Amount])
to get the desired result.

A side-effect of this design is that it is actually possible to put a
reversal entry through, i.e. you can use a negative Amount in either form.
In some designs that's very desirable; if you don't want that to occur, use
a Validation Rule on the Amount field of:
>=0


There are other ways to approach this issue. For example, you can make a
text box default to negative by examining its Text property in its
AfterUpdate event, and if the first character is not a sign ("+" or "-")
then negate its value.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Rose" <ro*******@earyhlonk.net> wrote in message
news:Mw*****************@newsread2.news.atl.earthl ink.net...
I have a transactions table with a field named Transaction. I want

Transaction
to be positive for input and negative for outflow. How do I set up the

form for
entering outflow so for data entry, the value is entered as a positive

number,
is stored as a negative number and when the form is opened to the same

record it
displays a a positive number. Is the form based on a query and if so what

does
the Transaction field in the query look like?

Thanks!

Rose


Nov 13 '05 #3

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

Similar topics

16
by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I...
10
by: TZoner | last post by:
1) Can one find the location of the 'Transaction Log' at: <Hard Disk>\Program Files\Microsoft SQL Server\MSSQL\Data\MyDb_Log.ldf? 2) Is it safe to delete it, as SQL will create a new Transaction...
3
by: Thiko | last post by:
Hi I take one nightly full database backup at 02:00 and backup the transaction log to one backup set every 15mins. The commands to do this are as follows and are set up to run as database...
2
by: Deepak Mehta | last post by:
i have to update two tables from ASP pages with same data but i want that both of them should be updated at one time. If either of them is not updated then my transaction should roll back.I want...
1
by: Avanish Pandey | last post by:
Hello All We have 3 differen services (in 3 different server) Service A,B,C . We want to implement distributed transaction when call methods of B and C from A. Is it possible? if yes then how? ...
2
by: John Lee | last post by:
Hi, I have few questions related to .NET 2.0 TransactionScope class behavior: 1. Check Transaction.Current.TransactionInformation.DistributedIdentifier to identify if distributed transaction...
1
by: Jason Huang | last post by:
Hi, I am just wondering how do we test the transaction's Commit and Rollback? How do we simulate a situation to let the transaction fail then Rollback? Thanks for help. Jason
15
by: Zeng | last post by:
Hi, The bigger my C# web-application gets, the more places I need to put in the tedious retrying block of code to make sure operations that can run into database deadlocks are re-run (retried)...
1
by: Matik | last post by:
Hi to all, Probably I'm just doing something stupid, but I would like you to tell me that (if it is so), and point the solution. There ist the thing: I' having a sp, where I call other sp...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.