"Stuart Masters" <st************@pcs-tr.swest.nhs.uk> wrote in message
news:60**************************@posting.google.c om...
Could somebody please tell me if it is possible, and if so how, to
place a command button on a form so that when it is clicked a black
line will be placed through all the clients information (name,
address, DoB, etc) on that form. Thus notifying others that that
person is deceased.
Many thanks for any help you can provide
Stu
As far as I can tell, you won't be able to use strike-thru font or text on
the form, but you can kludge it up this way:
* add a Yes/No field to the database table, indicating deceased or not
* for each text box you want to strike thru on the form, create a narrow
line object
* label the lines line1, line2, line3, etc.
* for all these lines, set the Visible property to No
* in the Form Open or Current event add this code
Dim ctl As Control, i As Byte, j As Byte
i = 1
For i = 1 to (whatever number of lines)
Me("line" & i).Visible = False
Next i
If Dlookup("Deceased_YN","Table","DeceasedName = '" &
Forms.FormName.DeceasedName & "'") = True then
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
Me("line" & i).Width = ctl.Width - 200
Me("line" & i).Left = ctl.Left + 100
Me("line" & i).Top = ctl.Top + (0.5 * ctl.Height)
Me("line" & i).Visible = True
i = i + 1
End If
Next ctl
Endif
The -200 and the + 100 positioning will start and end the line a little bit
inside the text box. It looks better (I think), as does a red line color.