G
Guest
Hi,
I have been asked at work to have a look at an error coming up on an ACCESS
database. The question was about a command button located on a form which
is suppose to open up a 'linked' database on the 'on click' event procedure.
The problem is that when clicking on this command button on a form it was
coming up with the error : [path name]invalid path, check that the name is
spelt correctly etc etc.
So I went into the command button's event procedure to have a look at the
code, but, as I am not a programmer I could not decipher through the private
sub where I could check/change the filepath the linked table is going to. I
will paste the code of the sub here:
Private Sub cmdOpenDREnterProfile_Click()
On Error GoTo Err_cmdOpenDREnterProfile_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmEnterProfile_DirectReport"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdOpenDREnterProfile_Click:
Exit Sub
Err_cmdOpenDREnterProfile_Click:
MsgBox Err.Description
Resume Exit_cmdOpenDREnterProfile_Click
End Sub
I am slowly learning more and more about ACCESS ( much through this help of
this wonderful forum) but I am a bit stumped here and wander if somone could
answer the following:
1. When you click on the event procedure and it brings up VB viewer, there
is often a list of subs (which I assume are seperate commands). Am I write in
assuming that the sub that it automatically tabs to when the event "..." is
clicked is the command it is referring to. For example; if I go into the
properties of a command button and click on the 'On Open' event procedure, do
I assume that the section in the VB editor (or the data between private sub
and... end sub) are the commands to be executived for that event?
If so then the code that I pasted above does not make sense to me, as I am
thinking it is suppose to say something about linking to another database and
it does not.
Hope I am not being confusing.
regards,
Angeline
I have been asked at work to have a look at an error coming up on an ACCESS
database. The question was about a command button located on a form which
is suppose to open up a 'linked' database on the 'on click' event procedure.
The problem is that when clicking on this command button on a form it was
coming up with the error : [path name]invalid path, check that the name is
spelt correctly etc etc.
So I went into the command button's event procedure to have a look at the
code, but, as I am not a programmer I could not decipher through the private
sub where I could check/change the filepath the linked table is going to. I
will paste the code of the sub here:
Private Sub cmdOpenDREnterProfile_Click()
On Error GoTo Err_cmdOpenDREnterProfile_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmEnterProfile_DirectReport"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdOpenDREnterProfile_Click:
Exit Sub
Err_cmdOpenDREnterProfile_Click:
MsgBox Err.Description
Resume Exit_cmdOpenDREnterProfile_Click
End Sub
I am slowly learning more and more about ACCESS ( much through this help of
this wonderful forum) but I am a bit stumped here and wander if somone could
answer the following:
1. When you click on the event procedure and it brings up VB viewer, there
is often a list of subs (which I assume are seperate commands). Am I write in
assuming that the sub that it automatically tabs to when the event "..." is
clicked is the command it is referring to. For example; if I go into the
properties of a command button and click on the 'On Open' event procedure, do
I assume that the section in the VB editor (or the data between private sub
and... end sub) are the commands to be executived for that event?
If so then the code that I pasted above does not make sense to me, as I am
thinking it is suppose to say something about linking to another database and
it does not.
Hope I am not being confusing.
regards,
Angeline