Autoeng
Why me?
- Local time
- Today, 18:01
- Joined
- Aug 13, 2002
- Messages
- 1,302
I have a report that receives data from a query but recently when I enter new data into the database the query is not picking up the new data until the record is exited and reentered. I have code in to generate a sequence number for each record entered into a subform of the form so that the subform records are displayed in a particular order (ascending according to the sequence number). This code was generated by a paid programmer and is the only thing of late to have changed but I am not getting any response from the programmer. Needless to say, it is the last I'll do business with him.
Is there anything here that could be causing the problem or what can I look at that might be the likely culpret?
On Current Event of the main form
Before Insert Event of the subform
Thanks,
Autoeng
Is there anything here that could be causing the problem or what can I look at that might be the likely culpret?
On Current Event of the main form
Code:
Private Sub Form_Current()
Dim varLookup As Variant
Me.Seq = 0
If Forms![frmMain].[ECNID] <> "" Then
varLookup = DMax("Seq", "tblECNParts", "[ECNID]= " & Forms![frmMain].[ECNID])
If Not IsNull(varLookup) Then
Me.Seq = CByte(varLookup)
End If
End If
End Sub
Before Insert Event of the subform
Code:
Private Sub Form_BeforeInsert(Cancel As Integer)
Forms!frmMain.Seq = Forms!frmMain.Seq + 1
Me.Seq = Forms!frmMain.Seq
End Sub
Thanks,
Autoeng