Alert text

ian_ok

Registered User.
Local time
Today, 20:26
Joined
May 1, 2001
Messages
90
I wish to add an alert text to a form I have.

I'm unsure how best to set this up.

What I was thinking of is to have a yes/no tick box, if ticked yes then alert text appears and you add in the data.

The alert text memo would be visible if yes ticked otherwise it wouldn't show.

At the moment I have it like this yet the alert text memo doesn't go when you click on next record.

What event should I put it on?

Is this the best way, any other ideas.

Thank you Ian
 
You might consider something like this instead of a text box with your alert in it:


On the AfterUpdate event of the tick box:

If Me.CheckBox = -1 Then 'If checked meaning yes

Msgbox "Your alert response here.", vbCritical, "Warning"
Me.WhereDataIsToBeAdded.Visible = True

Else

Exit Sub

Set that other control's visibility to No and also put on the OnCurrent event of the form itself:

Me.WhereDataIsToBeAdded.Visible = False
 
This is what have and it doesn't work if I move from one record to the next.

Private Sub Alert_AfterUpdate()
If Me.Alert = -1 Then
Me.altext.Visible = True
Else
Me.altext.Visible = False
End If
End Sub

AND

Private Sub Form_Current()
Me.altext.Visible = False

End Sub
 
Me.Alert is activating on the AfterUpdate event. The data would have to be UNCHECKED to fire the code. This will work on a new record only, which I think is what you wanted to do.

Add the If-Then to the Current event as well to see the data where Me.Alert = Yes.
 
Sorry.....I think I'm going round in circles here.

The form has 1200 records and if I move from 1 to the next it doesn't work.

I think all these if then true/false etc is sending me mad.

The alert text is for adding info if the person in the record has some points to remind users
Ian


[This message has been edited by ian_ok (edited 11-30-2001).]
 
Is the alert a textbox or a label? If textbox only thing that I can think of is that it might be locked. Otherwise the code works fine (might want to add Me.Alert = 0 as the first line on the Form_Current code to reset the box)
 
Is this tick box bound or unbound? If it is not bound, the value of it does not change on the OnCurrent event.
 
It isn't a continuous form.

And it is a bound tick box

[This message has been edited by ian_ok (edited 12-01-2001).]
 
I may have lost the plot but I think you want your alert message to pop up (or not) as you move from record to record. If that is so then this should do it:

Private Sub Form_Current()
If Me.Alert = -1 Then
Me.altext.Visible = True
Else
Me.altext.Visible = False
End If
End Sub

The code is in the On Current event of the form....
 
Leave your code in the After Update event of the checkbox where you have it. Then simply "Call" the Sub using the On Current event of the form so it will trigger when navigating through the records.

Private Sub Form_Current()
Call Alert_AfterUpdate
End Sub

HTH
RDH

[This message has been edited by R. Hicks (edited 12-01-2001).]
 

Users who are viewing this thread

Back
Top Bottom