S
Steve G
Hi All
I am using this code to tab from the last text box in a sub form back to the
next text box in the main form:
Private Sub PatWtDate_Exit(Cancel As Integer)
On Error GoTo Error_Routine
Dim RS As Recordset
Set RS = Me.RecordsetClone
Me.Dirty = False
RS.MoveLast
If StrComp(Me.Bookmark, RS.Bookmark, 0) = 0 Then
Forms![frmReferral]![InsID].SetFocus
' The following line may be removed in version 2.0
' Forms![Orders]![Orders Subform].Requery
End If
Exit Sub
Error_Routine:
MsgBox "You must be on a record with data"
Exit Sub
End Sub
This works well for new records...however, when I try using it in a form to
edit an existing record, I am getting the error message shown above: "You
must be on a record with data". In this instance, data is already
present....I've tried several modifications, but can't seem to get it to
work right...
Any help would be much appreciated.
Steve G
I am using this code to tab from the last text box in a sub form back to the
next text box in the main form:
Private Sub PatWtDate_Exit(Cancel As Integer)
On Error GoTo Error_Routine
Dim RS As Recordset
Set RS = Me.RecordsetClone
Me.Dirty = False
RS.MoveLast
If StrComp(Me.Bookmark, RS.Bookmark, 0) = 0 Then
Forms![frmReferral]![InsID].SetFocus
' The following line may be removed in version 2.0
' Forms![Orders]![Orders Subform].Requery
End If
Exit Sub
Error_Routine:
MsgBox "You must be on a record with data"
Exit Sub
End Sub
This works well for new records...however, when I try using it in a form to
edit an existing record, I am getting the error message shown above: "You
must be on a record with data". In this instance, data is already
present....I've tried several modifications, but can't seem to get it to
work right...
Any help would be much appreciated.
Steve G