Aug 25 2010, 04:00 AM
I have a problem with the attached continuous form: I need to detect, on 'On Current' event IF the AVG/hr is less than the value in the TextBox in the Footer of the form in order to send an e-mail.
I already created a "Conditional Formatting" (i.e. red) to point out the "Hot Values" and it works fine but if I use the IF/THEN condition in 'On Current" event ACCESS only check the AVG/HR in the first row of the form and ignore the rest unless I select the AVG/HR TextBox to check.
Any help will be really appreciated !
Aug 25 2010, 06:39 AM
What the actual code you're trying to use in the Current event?
Just in case you're misunderstanding something, the Current event fires when focus moves from one row to another. If you're referring to a control on your form in that event, it'll give the value of that control for the current row.
Aug 25 2010, 08:28 AM
Hi Doug !
Many thanks for your reply.
I tried to move the code into 'On Open' event but problem still occurs.
Private Sub Form_Open(Cancel As Integer)
If Me.AVR_HRcmd < Me.AVRcmd Then
I guess it happens because that's a continuous form: I'm trying to loop through command forms but I cannot figure it out
Aug 25 2010, 09:03 AM
In my opinion, the appropriate way to do this would be to have a button on the form that would create a recordset of all rows that need an e-mail sent then loop through that recordset row by row, sending out the e-mail.
It's certainly not something you'd want to do repeatedly as the form is used (in other words, you wouldn't want it in the Current event).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here