Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / June 2006

Tip: Looking for answers? Try searching our database.

comparing fields in multiple records, and then doing calculations

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 30 Jun 2006 14:41 GMT
Hi everyone! I've been doing a lot of work lately in MS XLS, but I need to
move a custom fuction I wrote in VBA from XLS to Access. I'm still trying to
learn the inner workings of Access. What I need to do is compare fields and
if the fields meet certain criteria I then need to do calculations on them.

The fields contain an ID (inserted by Access), then a work order number
(there may be several records with the same work order number, but with
different events logged), there are several time-stamp fields which I do
calculations on providing certain events happen (which is documented in the
records).

I guess what I'm trying to say, is I have a work log of service calls that I
need to make sure were handled within a specific amount of time, excluding
certain events and only counting certain events.

If anyone can point in the right direction for documentation on working with
multiple records and comparing them, it would be much appreciated.

Thank you,
Mike
Klatuu - 30 Jun 2006 21:05 GMT
Without knowing all the particulars, I can only provide a suggestion.  If you
are looking to find records in a table that need calculations based on
certain criteria, I would suggest a query.  If you are going to be making
changes to the values in the fields, then it would most likely need to be an
Update query.
To do this, what you need to do is determine the criteria on which records
should be selected.  You then need to write criteria into the query so that
it will affect only the records you want.  In the query builder, there is a
row called Update To:
This row populates a row in the table with the value entered.  That value
can be a hard coded value, a field from a related table, or can accept either
Access functions or user defined functions.
So, if you need to do a calculation on a field, you would write a VBA
function that performs the calculation and returns the results you want
stored in the field.  You would pass it a value or values it would need to
perform the calculation.

> Hi everyone! I've been doing a lot of work lately in MS XLS, but I need to
> move a custom fuction I wrote in VBA from XLS to Access. I'm still trying to
[quoted text clipped - 16 lines]
> Thank you,
> Mike
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.