Locked SubForm doesn't show all records SOMETIMES

P

Peter

I have a linked subform. I want to prevent edits to the data in the subform
unless people click a button... I thought that I would use the Locked
subform container property. There are two ways to get to my form, one is to
click the form, in this case the subform works perfectly. The other way is
to double click a field in another form. IN this case the subform does not
display any data. It is cactus. The code used to open the form in this
instance is :

Private Sub ServiceNumber_DblClick(Cancel As Integer)
On Error GoTo Err_ServiceNumber_DblClick

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frm_MntServiceNumber"

stLinkCriteria = "[ServiceNumber]=" & "'" & Me![ServiceNumber] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_ServiceNumber_DblClick:
Exit Sub

Err_ServiceNumber_DblClick:
stDocName = "frm_MntServiceNumber"
DoCmd.OpenForm stDocName, , , acNewRec

DoCmd.GoToRecord , , acNewRec
'MsgBox Err.Description
Resume Exit_ServiceNumber_DblClick

End Sub
 
Top