I have recently uploaded my access 2003 tables to an SQL server. I've
modified most of the code and everything is working properly except
for the hyperlink fields. I have several fields which are references
(links) to files on our server. It worked fine with the
CmdInsertHyperl ink in access, but now that we have linked tables, I
get this error message;
"2046: The command or action 'InsertHyperlin k' isn't available now."
I believe I need to modify my code with Insert statements, but I am
just now teaching myself the intricacies of SQL. Would anyone here
have any advice for accomplishing this with linked tables?
Below is a code sample to illustrate how I'm currently doing this:
Private Sub ContractLink_Cl ick()
Dim Response, MyString
On Error GoTo ContractLink_Cl ick_Error
If ValidLink(Me.Co ntract) = False Then
Response = MsgBox("file not found. Would you like to add one now?",
vbYesNo, "Add Document")
If Response = vbYes Then ' User choose Yes.
Contract.Visibl e = True ' text box to hold hyperlink
Contract.SetFoc us
DoCmd.RunComman d acCmdInsertHype rlink
ContractLink.Se tFocus
Contract.Visibl e = False
Else ' User choose No.
MyString = "No" ' Perform some action.
Contract.Visibl e = False
ContractLink.Se tFocus
End If
End If
exit_ContractLi nk_Click:
Exit Sub
ContractLink_Cl ick_Error:
If Err <2501 Then
MsgBox Err & ": " & Err.Description
Resume exit_ContractLi nk_Click
If (Err = conErrDoCmdCanc elled) Then
Resume Next
End If
End If
End Sub
Also, if you know of any good books that I can reference for further
learning, that would be most appreciated.
Sincerely,
M. Carrizales
modified most of the code and everything is working properly except
for the hyperlink fields. I have several fields which are references
(links) to files on our server. It worked fine with the
CmdInsertHyperl ink in access, but now that we have linked tables, I
get this error message;
"2046: The command or action 'InsertHyperlin k' isn't available now."
I believe I need to modify my code with Insert statements, but I am
just now teaching myself the intricacies of SQL. Would anyone here
have any advice for accomplishing this with linked tables?
Below is a code sample to illustrate how I'm currently doing this:
Private Sub ContractLink_Cl ick()
Dim Response, MyString
On Error GoTo ContractLink_Cl ick_Error
If ValidLink(Me.Co ntract) = False Then
Response = MsgBox("file not found. Would you like to add one now?",
vbYesNo, "Add Document")
If Response = vbYes Then ' User choose Yes.
Contract.Visibl e = True ' text box to hold hyperlink
Contract.SetFoc us
DoCmd.RunComman d acCmdInsertHype rlink
ContractLink.Se tFocus
Contract.Visibl e = False
Else ' User choose No.
MyString = "No" ' Perform some action.
Contract.Visibl e = False
ContractLink.Se tFocus
End If
End If
exit_ContractLi nk_Click:
Exit Sub
ContractLink_Cl ick_Error:
If Err <2501 Then
MsgBox Err & ": " & Err.Description
Resume exit_ContractLi nk_Click
If (Err = conErrDoCmdCanc elled) Then
Resume Next
End If
End If
End Sub
Also, if you know of any good books that I can reference for further
learning, that would be most appreciated.
Sincerely,
M. Carrizales
Comment