Junkee Brewster
Registered User.
- Local time
- Tomorrow, 09:44
- Joined
- May 21, 2005
- Messages
- 33
Hello again,
I'm having some problems calculating dates with VB on my subform. Here's the code I'm using (attached to the SubFrm)
This only seems to assign the date to the field in the FIRST row of the Subform. If I have multiple entries in the subform, then the date will only appear in row two onwards if I click on the date field(s) with my cursor.
Is it a coding error, or should I be putting the code NOT as Form_Current()?
Also, If I finish off the code after all my DateAdds with:
I get errors. I'm not sure if that part is needed anyways.. but it will work if I'm running off a Main Form only, but it seems the MainFrm/SubForm setup causes probs. I can't refer to it as Forms!SubFrmStuff!ReTest either as it says MSA can't find it.
Thanks again.
I'm having some problems calculating dates with VB on my subform. Here's the code I'm using (attached to the SubFrm)
Code:
Private Sub Form_Current()
If (Not IsNull(Me.LastTest)) Then
If Me.txtTestPeriod = 1 Then
Me.ReTest = DateAdd("yyyy", 1, Me.LastTest)
End If
If Me.txtTestPeriod = 3 Then
Me.ReTest = DateAdd("yyyy", 3, Me.LastTest)
End If
(etc etc.....)
Is it a coding error, or should I be putting the code NOT as Form_Current()?
Also, If I finish off the code after all my DateAdds with:
Code:
Else
Me.ReTest = " "
End If
End Sub
Thanks again.