Why do I get a compile error?

S

Steven V. Olson

When I execute the below code I get the following error:

Compile Error:

Method or Data Member Not Found.

The VBA editor opens and has the text .RXInputForm
highlighted in the subroutine. RXInputForm is the name of
a nested subform in my mdb file. This name is under the
Other tab of the subform.

Why am I getting a compile error when I run the below
subroutine?

Private Sub SelectLensOrSegmentStyle_Click()
On Error GoTo Err_SelectLensOrSegmentStyle_Click

Dim stDocName As String
Dim stLinkCriteria As String

Me.Repaint
Me.Requery
With Me.RXInputForm!Form.RecordsetClone
'Make sure there is at least one record.
'RX Input Form is the name of the subform under
'the Other tab of the of the Property Sheet of
'the subform when the main form is opened in
'design view.
If Not (.EOF And .BOF) Then
'Moves to last record on the subform.
.MoveLast
Me.RXInputForm!Form.Bookmark = .Bookmark
End If
End With

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, ,
acMenuVer70

stDocName = "Clear Lens Or Segment Styles Form"

stLinkCriteria = "[Rx#]=" & Me![RX#]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Restore

Exit_SelectLensOrSegmentStyle_Click:
Exit Sub

Err_SelectLensOrSegmentStyle_Click:
MsgBox Err.Description
Resume Exit_SelectLensOrSegmentStyle_Click

End Sub

Steve
 

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