Alert or Warning message

uploader

New member
Local time
Today, 03:47
Joined
Apr 4, 2012
Messages
8
Hello i'm a total newbie in access and i have none experience in VB code. I just click and work in design mode without using vb code, just macros.

I'm working in Access 2010

I have a query that sums up total of values from one table with fixed value in another table

Can someone please help me how to create alert message when i insert a number via form in the table to get warning if the sum is exceeding the value i choose...for example 50...

To be more specific i have an airplane flight database...
and when inserting a new airplane in database, that airplane has already had flight hours.
That is TTSN - Total Time Since New (for expl. 1000 flight hours)
and in another table i have a field for flight hours... (and sum for that field is for expl. 49 flight hours)

so in a query i sum up the value [TTSN] + [totalflighthours] and i get result 1049

Now i need to create alert to warn user when this result exceeds 1049...

I hope someone can help me...thank you!
 
When do you want to see this alert?
1. After the record is inserted/updated
2. Daily when you start the application
3. Other
 
When the result in query has gone over 1049

and it can get only when user inserts a new flight time...
so that would be after inserting a time in form...but the problem is that it sums up in query...and i dont know how to check that value so i could create a popup message that the value has been breached...
 
Use dSum(...) in the AfterUpdate event of the form to look up the sum which will include the already saved record. Or, if you want to give the user the chance to change the value or cancel the update, put the edit in the form's BeforeUpdate event. But in this case the dSum() will only sum the already saved records so you'll need to add the amount in the currently dirty record to get the total amount.
 
Just out of curiosity, what are you trying to achieve with this warning? Are you trying to determine maintenance when the AC hits its TBO time, when it's time for the 100 hour inspection, or something else?
 
yes thats right!

to warn user that it is time for inspection!

do you have something to recomend, or advice?

And why are the commercials oly in my posts? how to turn that off!
 
Last edited:
please someone just show me how to make any warning message related to field value...how to do that?
 
I'm taking a look at your DB. What is TTOE? Is that supposed to be Total Time since Engine Overhaul? Also, why are you logging time as minutes? Is there no hobbs meter in the a/c?
 
TTOE is total time on entry

When AC enters the database!

It is important to have minutes in flight log, but then again it's not important when calculating TTSN

and when plane gets 50h of flight then it's supposed to go on the first check...
i've created one query to select all planes that have more than 50h of flight...is there a way to create some warning when there is a plane in the query
 
If you have a query that selects the planes with maintenance issues then you can use DCount() function against this query. If the count comes back > 0 then a record is found and warn your users.

ex:

Code:
Private Sub AC_ID_AfterUpdate()
If DCount("*", "[COLOR="Red"]qryTotalAirTime[/COLOR]", "AC_ID =" & Me.AC_ID) > 0 Then
    MsgBox "Current selected airframe is due for maintenance", , "Warning Maintenance Alert"
End If
End Sub

Match whats marked in red with the name of your query.

JR
 
An alert/warning by itself seems to me not to be the best solution. When is this thing triggered? What if someone dismisses the warning and forgets about it, because of some distraction? Such things happen. When is it triggered next time?

There are other ways: eg display a permanent list of all aircraft and for each the time remaining until next service, those close to some limit can be coloured red. This is the most informative list. Alternatively, have the list only display those that are a few hours short or over the limit etc.
 
@ Spike

this is the best solution for me...please if you can teach me how to do that...how to change color in Form...i have a Form that shows hours and i want to change color automatically when certain value has been reached...how to do that?
 
I found it....this is great!!!

In Form design view first you have to choose field you want to format and then pick Format on the Ribbon and then pick Conditional Formatting...there is a user friendly interface that guides you for whatever you need.

Label of this post could be now changed to [SOLVED]
 

Users who are viewing this thread

Back
Top Bottom