I am working with Access 2000 , a main form "Input" with a subform "Transaction subform"
If I manully change the "biweeklydate" field on the subform my below code works perfectly.
This is on the After Update property of the sub form
Private Sub BiWeeklyDate_AfterUpdate()
DoCmd.RunMacro "weekdays"
If Forms![Input]![transaction subform]![Frequency] = "Daily" And Forms![Input]![transaction subform]![days of the week] = "Saturday" Then
Forms![Input]![transaction subform]![BiWeeklyDate] = DateAdd("d", 2, [BiWeeklyDate])
ElseIf Forms![Input]![transaction subform]![Frequency] = "Daily" And Forms![Input]![transaction subform]![days of the week] = "Sunday" Then
Forms![Input]![transaction subform]![BiWeeklyDate] = DateAdd("d", 1, [BiWeeklyDate])
ElseIf Forms![Input]![transaction subform]![Frequency] = "Other" And Forms![Input]![transaction subform]![days of the week] = "Saturday" Then
Forms![Input]![transaction subform]![BiWeeklyDate] = DateAdd("d", 2, [BiWeeklyDate])
ElseIf Forms![Input]![transaction subform]![Frequency] = "Other" And Forms![Input]![transaction subform]![days of the week] = "Sunday" Then
Forms![Input]![transaction subform]![BiWeeklyDate] = DateAdd("d", 1, [BiWeeklyDate])
End If
DoCmd.RunMacro "weekdays"
End Sub
However when the same field "biweeklydate" is change with the below code the above code does not work or is not activated
I did try placing the above code on the Change propery but will no effect.
This code is on the on Activate property of the sub form
Private Sub Form_Activate()
Do Until [CLIENTID] = "0"
'If Text104.Value = Forms![Input]![ActiveXCtl61].Value Then
'BiWeeklyDate.Value = Forms![Input]![ActiveXCtl61].Value
If Text104.Value <= Forms![Input]![ActiveXCtl61].Value And Forms![Input]![ActiveXCtl61].Value <= Date Then
BiWeeklyDate.Value = Text104.Value
End If
DoCmd.GoToRecord acDataForm, "TRANSACTION Subform", acNext, 1
Loop
End Sub
I have been tring to get this to work for 2 days now with no luck ANY help would be very welcome
Thanks
Liz
If I manully change the "biweeklydate" field on the subform my below code works perfectly.
This is on the After Update property of the sub form
Private Sub BiWeeklyDate_AfterUpdate()
DoCmd.RunMacro "weekdays"
If Forms![Input]![transaction subform]![Frequency] = "Daily" And Forms![Input]![transaction subform]![days of the week] = "Saturday" Then
Forms![Input]![transaction subform]![BiWeeklyDate] = DateAdd("d", 2, [BiWeeklyDate])
ElseIf Forms![Input]![transaction subform]![Frequency] = "Daily" And Forms![Input]![transaction subform]![days of the week] = "Sunday" Then
Forms![Input]![transaction subform]![BiWeeklyDate] = DateAdd("d", 1, [BiWeeklyDate])
ElseIf Forms![Input]![transaction subform]![Frequency] = "Other" And Forms![Input]![transaction subform]![days of the week] = "Saturday" Then
Forms![Input]![transaction subform]![BiWeeklyDate] = DateAdd("d", 2, [BiWeeklyDate])
ElseIf Forms![Input]![transaction subform]![Frequency] = "Other" And Forms![Input]![transaction subform]![days of the week] = "Sunday" Then
Forms![Input]![transaction subform]![BiWeeklyDate] = DateAdd("d", 1, [BiWeeklyDate])
End If
DoCmd.RunMacro "weekdays"
End Sub
However when the same field "biweeklydate" is change with the below code the above code does not work or is not activated
I did try placing the above code on the Change propery but will no effect.
This code is on the on Activate property of the sub form
Private Sub Form_Activate()
Do Until [CLIENTID] = "0"
'If Text104.Value = Forms![Input]![ActiveXCtl61].Value Then
'BiWeeklyDate.Value = Forms![Input]![ActiveXCtl61].Value
If Text104.Value <= Forms![Input]![ActiveXCtl61].Value And Forms![Input]![ActiveXCtl61].Value <= Date Then
BiWeeklyDate.Value = Text104.Value
End If
DoCmd.GoToRecord acDataForm, "TRANSACTION Subform", acNext, 1
Loop
End Sub
I have been tring to get this to work for 2 days now with no luck ANY help would be very welcome
Thanks
Liz
Code: