Google Answers Logo
View Question
 
Q: Play sound when changes on Access form when changes are made to records ( No Answer,   1 Comment )
Question  
Subject: Play sound when changes on Access form when changes are made to records
Category: Computers > Programming
Asked by: crom654-ga
List Price: $50.00
Posted: 18 Sep 2002 14:06 PDT
Expires: 19 Sep 2002 04:42 PDT
Question ID: 66600
I have an MS Access database (Access 2002). When users change a field
(let's call it the 'status' field) on a record using a query, they
close the query and get back to a form which displays a textbox for
each record. A colleague has set things so that the colors of these
textboxes correspond to the status' of the records.

Now what I need to do is set things so that when a user opens the
'master form' (the one that displays the textboxes that change color
based on records' status) a sound plays when there is a change to any
record's status field.
(I should say that my colleauge uses some crazy lookup in the
expression boxes of the textboxes to lookup the status of each record,
and change the colors of the textbox as needed.)

Here is a solution I was pondering. Let us say that there are 20
records in view here. That means 20 textboxes on the 'master form'.
Would there be a way to have 20 matching, hidden textboxes, each of
which take on the value of it's twin when the form is closed (using
vba, or whatever in the unload event)? O.K. so in the load event of
this form, I have code that checks each set of fields, and if there
are any that do not match, the sound goes off?  If this is a good
solution, please provide details, and even code, if you have pity and
time. If you have a better one, please provide.

The sound bit is not the crucial thing; I was thinking of using a
simple beep, but I see that one can even add an ole wav file and have
that run using vba in the load event of the form.

If this is not enough money, please say so and I may pay more.

Cheers and thanks!

Clarification of Question by crom654-ga on 18 Sep 2002 14:10 PDT
I don't feel like I was being very clear in explaining my solution. 

Each visible textbox on the master form would have a matching, hidden
textbox that would be assigned the former's value on unload of the
form. So what is happening is, when the form is loaded, the vba code
in the load event will be able to check if there have been changes,
and act accordingly. But what if the user does not 'load' the form?
What if it is just sitting there on his screen? Anayay, any help is
appreciated.

Clarification of Question by crom654-ga on 18 Sep 2002 16:07 PDT
Thanks Daevalmighty for the comment, but I fear I have still not
explained this thing well enough.
The 'master form' does not get edited. All it does is lay out the 20
texboxes, each of which is color coded to let the user know what the
status of the corresponding record is. (My colleague uses something
called conditional formatting to accomplish this). So the user
interacts with the data (sets the status of the records) via queries,
and when the queries are closed, the 'master form' should (and for her
and for other users on the network) display color changes in the
textboxes AND (if you can give me an anwer) play a sound.
For the purposes of this dicussion, there are 2 fields per record:
'name' and 'status'. 'Status' is the thing that changes the colors of
the textboxes on the 'master form'. In addition, changes in the status
field should result in sounds on the 'master form'. Am I making sense?
Answer  
There is no answer at this time.

Comments  
Subject: Re: Play sound when changes on Access form when changes are made to records
From: davealmighty-ga on 18 Sep 2002 14:52 PDT
 
Use the beforeupdate to set the value of the textbox to a temp value
Use the afterupdate to check the current value against the temp value
(this is to see if they actually changed anything or if they just
retyped the same value)
If the afterupdate detects a change then set a flag to indicate that a
change has been made.  On the onfocus event of the master form check
the flag.  If the flag is set then play the sound.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy