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

Problems creating an Auditing facility

Hi All,

I need some help regarding the creation of an auditing facility with
Access 97. First off, let me say that the following design is not my
idea but I'm in the unfortunate position of trying to implement it
somehow.

First, the user(s) require that certain fields be audited to see who
the data was last changed by and when it was changed. They initially
wanted this data to be in the ControlTip Text so they could see it by
simply hovering over the relevant control. After a large amount of
"heated" debates on the matter, they decided that they wanted some
hidden controls (a couple of text boxes and labels) that would appear
when the control had focus and then vanish when the next control is
selected. This in itself is easy enough but the text boxes where the
data is to appear is supposed to be disabled to stop anyone updating
the text with other data (although why anyone would do this escapes
me). With my limited knowledge of Access, I've set the controls to
appear when the control has focus and using the After Update event I've
set the text boxes to receive data from code that runs once the
original control is updated. One of the 2 text boxes is set to receive
the output from the Now() function and the other from the CurrentUser()
function (both built in functions). The text boxes are attached to
relevant columns in the table/query that feeds the form but I continue
to get an error that says the control can't be updated unless it has
focus.

I've tried to set focus to the relevant control before the update but
to no avail. I've even tried leaving the text box visible, enabled and
everything else but I'm currently banging my head against the
proverbial brick wall so any help you can offer would be most welcome.

If there is anyone who has another idea to record the person/time who
last updated a record then I'd be very grateful.

Many thanks in advance.

Dean...

Jan 30 '06 #1
3 1450
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I usually use the Form's BeforeUpdate event. E.g.:

Private Sub Form_BeforeUpdate(Cancel As Integer)

' User & Updated have to be part of the form's recordset.
Me.User = CurrentUser()
Me.Updated = Now()

End Sub

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ958qYechKqOuFEgEQINHQCgjIQ5CxuI8Pon5k0TVjFPyy JNyNIAoIfZ
nUiOZkcnFMrIpgVcNEh2wFZk
=Ibqr
-----END PGP SIGNATURE-----
DeanL wrote:
Hi All,

I need some help regarding the creation of an auditing facility with
Access 97. First off, let me say that the following design is not my
idea but I'm in the unfortunate position of trying to implement it
somehow.

First, the user(s) require that certain fields be audited to see who
the data was last changed by and when it was changed. They initially
wanted this data to be in the ControlTip Text so they could see it by
simply hovering over the relevant control. After a large amount of
"heated" debates on the matter, they decided that they wanted some
hidden controls (a couple of text boxes and labels) that would appear
when the control had focus and then vanish when the next control is
selected. This in itself is easy enough but the text boxes where the
data is to appear is supposed to be disabled to stop anyone updating
the text with other data (although why anyone would do this escapes
me). With my limited knowledge of Access, I've set the controls to
appear when the control has focus and using the After Update event I've
set the text boxes to receive data from code that runs once the
original control is updated. One of the 2 text boxes is set to receive
the output from the Now() function and the other from the CurrentUser()
function (both built in functions). The text boxes are attached to
relevant columns in the table/query that feeds the form but I continue
to get an error that says the control can't be updated unless it has
focus.

I've tried to set focus to the relevant control before the update but
to no avail. I've even tried leaving the text box visible, enabled and
everything else but I'm currently banging my head against the
proverbial brick wall so any help you can offer would be most welcome.

If there is anyone who has another idea to record the person/time who
last updated a record then I'd be very grateful.

Jan 30 '06 #2
Thanks MG,

Unfortunately, there are several fields on the form that require
auditing with the date changed and the username. I've created new
fields in the tables that feed the form (e.g. the Location field has
two other fields that I need updated called LocationAudit1 and
LocationAudit2 where the first records the date and the second records
the username when someone changes the Location field for that
particular record). The before update event would be fine if there was
only one item that needed auditing.

Dean...

Jan 30 '06 #3
Use the AfterUpdate event of the control being audited

Private LocationAudit_AfterUpdate()
Me!LocationAudit1 = Now
Me!LocationAudit2 = CurrentUser
End Sub
*** Sent via Developersdex http://www.developersdex.com ***
Jan 31 '06 #4

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

Similar topics

1
by: Irmen de Jong | last post by:
Hi I'm trying to create e-mail content using the email.MIMEText module. It basically works, until I tried to send mail in non-ascii format. What I did, to test both iso-8859-15 and UTF-8...
5
by: Lili | last post by:
I'm having problems creating a simple stored procedure in DB2. Can someone help? Here is the screen dump when I tried to load the stored procedure. Thanks for any help. Create procedure...
2
by: | last post by:
Hi all, I have vs.net 2003 locally installed on my XP PRO machine. I have a web server on the LAN which has a website configured at http://services. This is accessible via my web browser and...
1
by: Ir0neagle | last post by:
I am generating upgrade/new install scripts for my project. I am able to do this in oracle and sql server but an running into problems in db2. What I am trying to do is to use some logic to only...
2
by: GGawaran | last post by:
Ive setup the MySQL server and am using heidi to create the tables, Ive had no trouble creating any new databases or certain tables. But my problem im running into right now, im trying to create a...
6
by: Charlie Bear | last post by:
i'm really stuck with this one can anyone help! i have a website that uses c#. it creates a series of directories and files from an xml source. when the xml changes, the directory that the...
1
by: MichaelZ | last post by:
After all is done, I want query(s) which will give me the ability to create a report which will allow me to compare 3 apts with the parameters equaling bedroom size, and rents which are equal or...
6
by: Pep | last post by:
Firstly, I'm not sure if this is the right group for this query, so please forgive me if I am wrong. My problem is that most users I distribute my software to cannot install it on their systems...
0
by: Scott McNair | last post by:
My apologies for crossposting this; I originally posted it to m.p.d.l.vb.data, but then I noticed that the group is not very active so I decided to post here as well. Subject: Problems creating...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.