Code for Saturday with spin button

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

Hi,

I currently have an Unbound text box that I enter a date, this date is
always a Saturday and as such, I'd like to have a spin button whereby I
could simply select up or down to move between Saturdays. If possible, I'd
like the default date to always be the previous Saturday to the week I'm
working.

Appreciate any sample code with some basic instructions.

Thanks, Rob
 
Rob said:
I currently have an Unbound text box that I enter a date, this date is
always a Saturday and as such, I'd like to have a spin button whereby I
could simply select up or down to move between Saturdays. If possible, I'd
like the default date to always be the previous Saturday to the week I'm
working.


Here's some ideas.

The Saturday before the current date can be calculated by:
DateAdd("d", 1 - WeekDay(Date(), 7), Date())

Access doesn't have a built-in spin control, but you can
simulated it fairly easily by using to buttons next to a
text box. The next button's Click event could be a simple
as
Me.thetextbox = Me.thetextbox + 7
 
Thanks Marshall, both suggestions work well. Rob
Marshall Barton said:
Here's some ideas.

The Saturday before the current date can be calculated by:
DateAdd("d", 1 - WeekDay(Date(), 7), Date())

Access doesn't have a built-in spin control, but you can
simulated it fairly easily by using to buttons next to a
text box. The next button's Click event could be a simple
as
Me.thetextbox = Me.thetextbox + 7
 
Back
Top