I'm new to the forum and also a VERY new user of Access to develop databases. I'm building a DB for a driving instructor acquaintance, and he wants a button on the pupil data entry form which he can click to flag a pupil as "Do Not Rebook" (i.e. if they're a non-payer or something). Upon clicking the button, he wants a value to be recorded in the appropriate field in the table (so we can report on it later) and he also wants the background of the entire record to turn red.
i've created the toggle button on the form and when I click it, it records a value in the table to which the form is bound (the data type is set to on/off). So far so good. I then browsed this forum and managed to find some code which i adapted (probably very badly!!) to make the background colour of the form change to red at the time the button is clicked. However, what happens when I click is that the background colour is then changed on ALL the records in the form, rather than just the one I'm interested in. It also doesn't remember the formatting if I exit and go back into the form. This is important as he wants an instant visual reminder not to rebook certain individuals.
Is it possible to restrict the background colour change to just one record, and to get Access to remember this for next time?
I've posted the code I've got so far below plus some info on the field names/form name. I really am a total novice so I hope I've put enough info - any help much appreciated!
Thx
=:o*
Code below is attached to On Click Event Procedure of a toggle button bound to DNR field in t_Pupils. Button itself is on form f_Pupils, bound to t_Pupils
Expand|Select|Wrap|Line Numbers
- Private Sub DNR_Click()
- If Me.DNR = -1 Then
- Me.Section(acDetail).BackColor = vbRed
- Else
- Me.Section(acDetail).BackColor = 16777215
- End If
- End Sub