Please Help!?? Hyperlink Coding

G

Guest

I have the basic code setup but it isn't quite working. I have a button that
when clicked:
If my hyperlink field has any value other then null, I would like to open
that hyperlink. If the fields value is null then I want to do something else.
I'm struggling with the first part! Your help would be much appreciated!
Cheers
 
G

Guest

If IsNull([hyperlink field]) then
... do some other code
Else
... Open hyperlink
End if
 
G

Guest

The problem is I have a If function within an If function. Ok heres what I
have:

If (Nz(Me.Work_Instruction.Value, "") = "") Then
ans = MsgBox("This Job has no Work Instruction." & vbCrLf & _
"Would You Like to Create one?", vbInformation + vbYesNo, _
"No Work Instruction")

If (ans = vbYes) Then
sDefaultDir = "Y:\AshleyS\Trim Line\Blank Template.doc"

Me.Work_Instruction.SetFocus
sOrigText = Me.Work_Instruction.Text

Me.Work_Instruction.Text = sDefaultDir
RunCommand acCmdOpenHyperlink

If (Me.Work_Instruction.Text = sDefaultDir) Then
Me.Work_Instruction.Text = sOrigText


End If
End If
End If


Exit Sub
--
Regards

Ashley Smart


Dennis said:
If IsNull([hyperlink field]) then
... do some other code
Else
... Open hyperlink
End if

A. Smart said:
I have the basic code setup but it isn't quite working. I have a button that
when clicked:
If my hyperlink field has any value other then null, I would like to open
that hyperlink. If the fields value is null then I want to do something else.
I'm struggling with the first part! Your help would be much appreciated!
Cheers
 
G

Guest

Put an Else before your last End If as I have done.

A. Smart said:
The problem is I have a If function within an If function. Ok heres what I
have:

If (Nz(Me.Work_Instruction.Value, "") = "") Then
ans = MsgBox("This Job has no Work Instruction." & vbCrLf & _
"Would You Like to Create one?", vbInformation + vbYesNo, _
"No Work Instruction")

If (ans = vbYes) Then
sDefaultDir = "Y:\AshleyS\Trim Line\Blank Template.doc"

Me.Work_Instruction.SetFocus
sOrigText = Me.Work_Instruction.Text

Me.Work_Instruction.Text = sDefaultDir
RunCommand acCmdOpenHyperlink

If (Me.Work_Instruction.Text = sDefaultDir) Then
Me.Work_Instruction.Text = sOrigText


End If
End If
Else
Msgbox "The Job has a work instruction"
End If


Exit Sub
--
Regards

Ashley Smart


Dennis said:
If IsNull([hyperlink field]) then
... do some other code
Else
... Open hyperlink
End if

A. Smart said:
I have the basic code setup but it isn't quite working. I have a button that
when clicked:
If my hyperlink field has any value other then null, I would like to open
that hyperlink. If the fields value is null then I want to do something else.
I'm struggling with the first part! Your help would be much appreciated!
Cheers
 

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