Hyperlink Error Message Required

S

Sue Wilkes

I have been struggling with my problem for a week and have tried various
self help sites. I have a text box on a form bound to a table which is
datatype hyperlink. All works well I can open the files from the links no
problem. What I have are two forms, one for adding records and one for
editing records. On adding records I use the following code

If IsNull(Me.Hyperlink1) Then
MsgBox conMESSAGE, vbExclamation, "ENTER HYPERLINK BEFORE CONTINUING"
Canel = True
Me.Hyperlink1.SetFocus
End If

On the event OnGotFocus of my command button to print the document.

In the edit form, I moved the code to BeforeUpdate of the individual
controls and it works okay however with the hyperlink field I have tried
using the code in several places on the control (text field) including
BeforeUpdate but cannot get the message to appear, or stop the user saving
and closing the form without the hyperlink1 field being populateed. All I
seem to be able to manage is to get the run time error 3314 as the field is
set to required in the table. Does any one know of a code which if the
hypelink is selected then deleted so the field is blank it would prompt the
user to select another hyperlink as the control/field cannot be blank. I
suspect that deleting the link in the hyperlink field behaves differently to
ordinary text being deleted but I do not know what the difference is?

Thanking you in anticipation for your assistance this is my last stumbling
block to getting this database up and running, I would not have got this far
without the help of these discussion forums, so thank you to all those who've
helped.

Best regards
Sue Wilkes
 

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