472,093 Members | 2,514 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,093 software developers and data experts.

Placing a black line through deceased items

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
Nov 12 '05 #1
2 1405
On 6 Apr 2004 05:07:21 -0700, Stuart Masters wrote:
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


Access does not support strike-through text.

A better solution would be to simply change the control's backcolor or
forecolor. That's easily done.

All you need is a [Deceased] (Yes/No datatype) field added to the
table, and if you are using Access 2000 or later, code each control's
Conditional Formatting property to change the color.

Set the Condition1 drop-down of each control to
Expression Is
In the dialog box along side the drop-down write:
[Deceased] = -1

Set the colors accordingly.
Repeat for each control on the form that you wish to change.

Check the box (no Command Button needed) to indicate deceased, and the
colors will change.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 12 '05 #2
DFS
"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.

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Phil Powell | last post: by
9 posts views Thread by Adi | last post: by
6 posts views Thread by Jerry West | last post: by
1 post views Thread by AliR \(VC++ MVP\) | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.