By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,807 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,807 IT Pros & Developers. It's quick & easy.

Check to see if a number is exactly divisible by seven

P: n/a
Senario: I need to reschedule an action. I need to make the
"reschedule in" days only multiples of seven so that the action will
happen on the same day, only a week or two (or more) in the future.

Problem: How can I formulate in VBA so see if the value entered in the
"Reschedule In" field is a multiple of seven. If it isn't I can then
reject it with a msgbox and ask them to enter a number that is a
multiple of seven.

Why: It's basically a frig so that only weekdays are picked for the
reschedule date instead of having them crossing over to weekends.

Hope you can help.

Lynx101

Feb 15 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
iif(([DaysOnly] mod 7)=0,True,False)

<ma**********@gmail.comwrote in message
news:11*********************@p10g2000cwp.googlegro ups.com...
Senario: I need to reschedule an action. I need to make the
"reschedule in" days only multiples of seven so that the action will
happen on the same day, only a week or two (or more) in the future.

Problem: How can I formulate in VBA so see if the value entered in the
"Reschedule In" field is a multiple of seven. If it isn't I can then
reject it with a msgbox and ask them to enter a number that is a
multiple of seven.

Why: It's basically a frig so that only weekdays are picked for the
reschedule date instead of having them crossing over to weekends.

Hope you can help.

Lynx101

Feb 15 '07 #2

P: n/a
On 15 Feb, 20:28, "paii, Ron" <p...@packairinc.comwrote:
iif(([DaysOnly] mod 7)=0,True,False)

<mattcolen...@gmail.comwrote in message

news:11*********************@p10g2000cwp.googlegro ups.com...
Senario: I need to reschedule an action. I need to make the
"reschedule in" days only multiples of seven so that the action will
happen on the same day, only a week or two (or more) in the future.
Problem: How can I formulate in VBA so see if the value entered in the
"Reschedule In" field is a multiple of seven. If it isn't I can then
reject it with a msgbox and ask them to enter a number that is a
multiple of seven.
Why: It's basically a frig so that only weekdays are picked for the
reschedule date instead of having them crossing over to weekends.
Hope you can help.
Lynx101- Hide quoted text -

- Show quoted text -
Perfect, thanks for your time. I'm fairly new to VBA, learning all the
time (with a lot of help from Google groups!)

Lynx101

Feb 15 '07 #3

P: n/a
On Feb 15, 2:14 pm, mattcolen...@gmail.com wrote:
Senario: I need to reschedule an action. I need to make the
"reschedule in" days only multiples of seven so that the action will
happen on the same day, only a week or two (or more) in the future.

Problem: How can I formulate in VBA so see if the value entered in the
"Reschedule In" field is a multiple of seven. If it isn't I can then
reject it with a msgbox and ask them to enter a number that is a
multiple of seven.

Why: It's basically a frig so that only weekdays are picked for the
reschedule date instead of having them crossing over to weekends.

Hope you can help.

Lynx101
You could also have them enter the number of weeks, and then multiply
that by 7.

Also, another way to skin this cat is to look at the dateadd()
function. (Just Search Access help for "dateadd".)

Jon

Feb 16 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.