G
Guest
I have a form that has an image as the main item on it. th image is an
exploded schematic of an appliance with parts references on it.
The problem is that I have placed labels over the parts references and on
the click event of the label the following code runs.
Private Sub Label4_Click()
On Error GoTo Err_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Part"
stLinkCriteria = "Partid =" & Me.Label4.Caption
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Click:
Exit Sub
Err_Click:
MsgBox Err.Description
Resume Exit_Click
End Sub
The caption contains the PartID
This works fine, however, the seven forms like this seem to have so much
code that the database is blowing up to 85 meg. I have used compact and the
image itself is under 250K.
What I want to try to do is to convert this to a function but have so far
been unsuccessful at being able to return the label number into the code
programatically. Each form may have up to 70 labels with events attached.
Thanks in advance.
exploded schematic of an appliance with parts references on it.
The problem is that I have placed labels over the parts references and on
the click event of the label the following code runs.
Private Sub Label4_Click()
On Error GoTo Err_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Part"
stLinkCriteria = "Partid =" & Me.Label4.Caption
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Click:
Exit Sub
Err_Click:
MsgBox Err.Description
Resume Exit_Click
End Sub
The caption contains the PartID
This works fine, however, the seven forms like this seem to have so much
code that the database is blowing up to 85 meg. I have used compact and the
image itself is under 250K.
What I want to try to do is to convert this to a function but have so far
been unsuccessful at being able to return the label number into the code
programatically. Each form may have up to 70 labels with events attached.
Thanks in advance.