C
Chlaris
Dear all,
I have header and details forms, let say frmInvoiceMain and frmInvoiceDetail
In header form , I have field User Modified and Date Modified.
In details form (frmInvoiceDetails), I have code like below :
Private Sub Form_AfterUpdate()
UpdateRecordStatus Me.Parent!InvoiceNo
End Sub
Private Sub UpdateRecordStatus(strInvoiceNo As String)
Dim strSQL As String
Dim rst As DAO.Recordset
Dim db As DAO.Database
strSQL = "SELECT UserModified, DateModified "
strSQL = strSQL & "FROM tblInvoiceMain WHERE InvoiceNo= '" & strInvoiceNo
& "'"
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
With rst
If Not .EOF Then
.Edit
!UserModified = CurrentUser
!DateModified = Now
.Update
End If
End With
rst.Close
Set rst = Nothing
End Sub
The problem is every time the user insert record in details section, then
the form (frmInvoiceDetail) will scroll up.
How to prevent the form from scrolling ?
Many thanks before.
Chlaris.
I have header and details forms, let say frmInvoiceMain and frmInvoiceDetail
In header form , I have field User Modified and Date Modified.
In details form (frmInvoiceDetails), I have code like below :
Private Sub Form_AfterUpdate()
UpdateRecordStatus Me.Parent!InvoiceNo
End Sub
Private Sub UpdateRecordStatus(strInvoiceNo As String)
Dim strSQL As String
Dim rst As DAO.Recordset
Dim db As DAO.Database
strSQL = "SELECT UserModified, DateModified "
strSQL = strSQL & "FROM tblInvoiceMain WHERE InvoiceNo= '" & strInvoiceNo
& "'"
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
With rst
If Not .EOF Then
.Edit
!UserModified = CurrentUser
!DateModified = Now
.Update
End If
End With
rst.Close
Set rst = Nothing
End Sub
The problem is every time the user insert record in details section, then
the form (frmInvoiceDetail) will scroll up.
How to prevent the form from scrolling ?
Many thanks before.
Chlaris.