I seem to remember
DatePart("ww", Me.thedate)
Assuming your date box is called thedate
Sent from my iPhone using Tapatalk
Thanks this works great, but how do I get the textbox - 'txtWeek' to auto-update. The week number only appears when I click on the textbox.
Change the on_update event of the year textbox to
Me.recalc()
Sent from my iPhone using Tapatalk
I must be going wrong somewhere still only changes when selected.
This is the code I am using...
Private Sub thedate_AfterUpdate()
Me.txtWeek = DatePart("ww", Me.thedate)
End Sub
Private Sub txtWeek_AfterUpdate()
Me.Recalc()
End Sub
In design mode add me.txtweek= etc as the controlsource of your week textbox. That should do it. And you shouldn't need the vba code you have
Sent from my iPhone using Tapatalk
This material may give you more insight on the issue.
Good luck.
Thats where i put it at the first attempt, But the week number still only appears when I click in the textbox.
I've tested this and it does work (sorry was nowhere near a computer before)
My date box was called update_date. You'll have to change it.
Paste this in the form class you are using as the _change event for the date field
Code:Private Sub update_date_Change() Me.Recalc End Sub
This code can be pasted into the control source for the weekbox
Code:=DatePart("ww",[update_date])
Excellent.
thank you very much.