473,412 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Check to see if a number is exactly divisible by seven

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
3 5363
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
by: Dag | last post by:
Is there a python module that includes functions for working with prime numbers? I mainly need A function that returns the Nth prime number and that returns how many prime numbers are less than N,...
54
by: richard_quick_uk | last post by:
Hi, If anyone's got the time I'd really appreciate any feedback on the accessibility of this site: http://www.cata.co.uk/_index.a­sp
2
by: Colin Mardell | last post by:
I need to get VBA to produce a msgbox when the number of records in the background query is exactly divisible by 5.
32
by: Cmorriskuerten | last post by:
HI, is this is this solution to test if a number is a prime number or not: /* * Is n a prime number? * Return TRUE (1): n is a prime number * Return FALSE (0): n is a *not* a prime number...
10
by: JackM | last post by:
I'm still working on validating the phone numbers that are entered on a form but have come across a problem I don't understand how to fix. I can handle most instances when it's in regular US...
21
by: Frederick Gotham | last post by:
I'm trying to devise a compile-time constant for X, where X is the greatest number which satisfies both the following criteria: (1) X <= DESIGNATED_MAX_VALUE (2) X % Y == 0 I'll try to...
5
debasisdas
by: debasisdas | last post by:
A ten-digit number contains every digit from 0 to 9. The digits are arranged so that the number formed by the first two digits, reading from left to right, is divisible by 2, the number formed by...
5
by: veki | last post by:
Hello, What shoud I change in this code to check, if some number is december: #include <iostream> #include <stdio.h> using namespace std; int main(){
2
HaLo2FrEeEk
by: HaLo2FrEeEk | last post by:
I need to check if a given number is an int or a double. I don't want to round doubles to ints, I just want to know if the number is an int or a double. Is there any way to do this? For the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.