Jackie
02-25-2001, 09:54 AM
I am suppose to have this database delivered tomorrow at 8am. All is completed but I am having problems with my form.
Problem 1:
Mainform = RepairLogEntry
Subform = AutoInfo
Nested Subform (in AutoInfo) = CustInfo
When I leave the last field on CustInfo I need the focus to go back to the mainform, RepairLogEntry, first control (DistCenter), next record.
I have searched this forum and the only thing I found was as Microsoft site with code written. I am not good with code and cannot seem to get this to work.
Private Sub Discount_Exit(Cancel As Integer)
On Error Goto Error_Routine
Dim RS As Recordset
Set RS = Me.RecordsetClone
RS.MoveLast
If StrComp(Me.Bookmark, rs.Bookmark, 0) = 0 Then
Forms![RepairLogEntry]![DistCenter].SetFocus
' The following line may be removed in version 2.0
Forms![RepairLogEntry]![AutoInfo Subform].Requery
End If
Exit Sub
Error_Routine:
MsgBox "You must be on a record with data"
Exit Sub
End Sub
Do I just have a control not in the right place? Or not even close to getting it right?
Problem 2:
When a search on the form is preformed and the record appears I would like it to be the latest record to date. I am receiving the oldest. Is there a way I can change this?
In advance, thank you very much!
Jackie
Problem 1:
Mainform = RepairLogEntry
Subform = AutoInfo
Nested Subform (in AutoInfo) = CustInfo
When I leave the last field on CustInfo I need the focus to go back to the mainform, RepairLogEntry, first control (DistCenter), next record.
I have searched this forum and the only thing I found was as Microsoft site with code written. I am not good with code and cannot seem to get this to work.
Private Sub Discount_Exit(Cancel As Integer)
On Error Goto Error_Routine
Dim RS As Recordset
Set RS = Me.RecordsetClone
RS.MoveLast
If StrComp(Me.Bookmark, rs.Bookmark, 0) = 0 Then
Forms![RepairLogEntry]![DistCenter].SetFocus
' The following line may be removed in version 2.0
Forms![RepairLogEntry]![AutoInfo Subform].Requery
End If
Exit Sub
Error_Routine:
MsgBox "You must be on a record with data"
Exit Sub
End Sub
Do I just have a control not in the right place? Or not even close to getting it right?
Problem 2:
When a search on the form is preformed and the record appears I would like it to be the latest record to date. I am receiving the oldest. Is there a way I can change this?
In advance, thank you very much!
Jackie