Need help with setting up a field input and a validation rule

M

Megaton

Hello

Let me explain my real problem a bit first. I have got 4 fields (Received,
HandedOut, Storage and Office). When I receive something I put them to the
storage and when I hand out something, I take them from the office. I also
need to move stuff between storage and office. But I only do one transaction
at a time. For instance,
if [Received]=40, then [Storage]=40; //received 40 stuff and put them in
storage
if [HandedOut]=30, then [Office]=-30; //took 30 stuff from office and handed
out
if [Storage]=-50, then [Office]=50; //moved 50 stuff from storage to office

To reduce the chance of inputing a wrong number, I would like to link these
fields together so that one field can generate the correct number based on
the other inputs.
My first question is: How can I set up the [Storage] field so that it can
take manual input to generate a number for [Office] field and in the mean
time, it can be auto-generated from [Received]?
Second question: How to set up the validation rule for [HandedOut] field to
meet these constrains (1. must be non-negative. 2. must be 0 if [Received]>0)?

Thank you so much.
 
J

Jeff Boyce

I can't quite puzzle out what you are putting in those fields ... is that
the number (i.e., the count) of an item?

"Moving things", is that only moving physical items, or are you trying to
replicate this in your database? (I hope not ... that would make your
database ... a spreadsheet!).

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
D

Daryl S

If this is to be entered on a form, I would put on the form a text box to
capture "Quantity" and an option group for "Action", with possible radio
buttons for "Receive", "Move", and "Hand Out". Finally a command button to
"Post Transaction". Behind the command button you can code the correct
fields, e.g. Received = quantity and Storage = Quantity if the Receive radio
button is selected.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top