AndreAraujo
Programmer
Thanks for taking time to read this. My application has one main form with a sub form on it. When i add a new record in the main form using the code;
Private Sub cmdAdd_Click()
Dim Rst As Recordset
Set Rst = Me.Recordset
Rst.AddNew
'**********************
me.Num = NovaOrdem()
Rst.Update
Rst.Close
Set Rst = Nothing
End sub
The event On Current of the sub Form is activated after the command RST.addnew and before i get the vale for me.Num, then i get a error because the num value is used in the Sub Form On current event.
Can i force the on current event of the sub to wait for the generation of the Num value??
André
Private Sub cmdAdd_Click()
Dim Rst As Recordset
Set Rst = Me.Recordset
Rst.AddNew
'**********************
me.Num = NovaOrdem()
Rst.Update
Rst.Close
Set Rst = Nothing
End sub
The event On Current of the sub Form is activated after the command RST.addnew and before i get the vale for me.Num, then i get a error because the num value is used in the Sub Form On current event.
Can i force the on current event of the sub to wait for the generation of the Num value??
André