Deactivate Hyperlink

S

Stockwell43

Hello,

I have a procedure tracker database I am working on. We have a list of
procedures that are completed and some that need to be completed. I have a
cbo named Completed with Yes/No option and a field named ProcNumber (for
procedure number) and this field is a hyperlink so the user can click in this
field and pull the completed procedure. My question is this:

Can I some how deactivate the hyperlink field (ProcNumber) if the Completed
cbo is set to No? But if the cbo is set to Yes (procedure is completed) then
the hyperlink field (ProcNumber) is activated so the procedure can be viewed?

It sounds easy but not sure what the actual code would be and the
appropriate place to insert it.

Your help is most appreciated, thanks!!!!
 
S

Stockwell43

I think I got it. I put this code in the forms current event:

If Me.Completed = "Yes" Then
Me.ProcNumber.Enabled = True
Else
Me.ProcNumber.Enabled = False
End If

Seems to work but when I click from no to yes, I have to go to the next
record and come back to activate it but that fine. If I placed it in the
wrong spot, please let me know where it should be placed.

Thanks!!
 
S

schasteen

You also need to put this in the after update event of the completed control.
This will prevent you from having to scroll between records to get it to
work.
 
S

Stockwell43

Perfect!

Thank you so much for your help!

schasteen said:
You also need to put this in the after update event of the completed control.
This will prevent you from having to scroll between records to get it to
work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top