addition in field w/o query?

T

trowelgirl

I am using Access 2003 for archaeological analysis. I have two groups of
pottery that really should be lumped into one group, but from the beginning
of the field season, they were separated. The only way I can think of around
this currently is to enter each, which is unncecessary, and create a query to
sum them in a new column. If I have 100 potsherds of type A and 23 of type B,
is there a way simply to enter 100 + 23 to have the total 123 calculate in
the field? The other option is to calculate as I go, and that is getting very
time-consuming. I can't use an OCR scanner to help on this project, either,
because reports are hand-written and not easily recognized by OCR.
 
J

Jeff Boyce

I'm having trouble visualizing what it is that you are storing in the field.
Can you post a description of the table structure?

If you want to know how many rows are in a table, use a Totals query and the
"Count" aggregation. You can also use the "GroupBy" aggregation to find how
many of TypeA and how many of TypeB, if that information is in one of your
fields.

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
T

trowelgirl

I am storing the quantity of pieces of pottery and total weight. I have one
field horizontally for pottery, but the way data was collected, pottery was
split into two groups: type A and type B. It basically just needs to be all
one big, happy group. I don't want to differentiate between the types.

What I have to do right now is add up the count of type A and type B, and
their respective weights before entering them in the quantity and weight
fields. It would save me so much time if I could find an equivalent to typing
in 100 + 23, and then have 123 populate in the field. I'm not trying to sum
quantities of already entered data, just trying to streamline the data entry
process. Does that make sense? Thanks!
 
J

John W. Vinson

What I have to do right now is add up the count of type A and type B, and
their respective weights before entering them in the quantity and weight
fields. It would save me so much time if I could find an equivalent to typing
in 100 + 23, and then have 123 populate in the field. I'm not trying to sum
quantities of already entered data, just trying to streamline the data entry
process. Does that make sense? Thanks!

You can do this with a bit of VBA code. You'll need a Form with three
textboxes, one for the A and one for the B, with the third bound to the table
field for the total. In the AfterUpdate event of the A and B textboxes put
code like

Private Sub txtA_AfterUpdate()
Me!txtC = NZ(Me!txtA) + NZ(Me!txtB)
End Sub

to overwrite whatever is now in the bound textbox txtC with the sum of the
other two. You can use more elaborate code to wait until both A and B are
entered, ask if an existing value should be overwritten, etc. if you wish.

If you're entering data into table datasheets... don't. VERY limited.

John W. Vinson [MVP]
 

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

Top