G
gb
Hello
I am looking to replicate work I currently undertake in Excel by using an
Access database. At this stage, I want to verify whether this is going to
possible, and if so, how.
As part of the work, I need to enter a number, or number range, and if the
number, or a number within the range, already exists within the database, to
flag up a warning by means of a msgbox.
The numbers to be inputted are all 11 digits in total. However, they are
entered in 3 parts. The first part is the first 7 digits. The second and
third parts are the last 4 digits. They need to be stored as text, as any
of the numbers could start with 0. If the number being entered is a single
number, parts 2 and 3 are identical. Part 3 is different to part 2 if
entering a range. For example:
Single number: 0123456 7890 7890
Range number: 0123456 7895 7899
So if I were to enter 0123456 7897 7897, this should flag up an error (as it
falls within the 0123456 7895 to 7899 range). If I were to enter 0123456
7891 to 7905, this should also flag up an error, as a number range that
falls within this new range already exists.
I hope this makes sense. The check needs to work whether a single or range
number is being entered.
Can someone tell me how in VBA I achieve this, please?
Would it also be possible for the msgbox alert to also advise which record
number is causing the problem? (assuming a standard autonumber for each
record).
Thanks for your help with this. I'm grateful for the efforts everyone puts
in here.
gb
I am looking to replicate work I currently undertake in Excel by using an
Access database. At this stage, I want to verify whether this is going to
possible, and if so, how.
As part of the work, I need to enter a number, or number range, and if the
number, or a number within the range, already exists within the database, to
flag up a warning by means of a msgbox.
The numbers to be inputted are all 11 digits in total. However, they are
entered in 3 parts. The first part is the first 7 digits. The second and
third parts are the last 4 digits. They need to be stored as text, as any
of the numbers could start with 0. If the number being entered is a single
number, parts 2 and 3 are identical. Part 3 is different to part 2 if
entering a range. For example:
Single number: 0123456 7890 7890
Range number: 0123456 7895 7899
So if I were to enter 0123456 7897 7897, this should flag up an error (as it
falls within the 0123456 7895 to 7899 range). If I were to enter 0123456
7891 to 7905, this should also flag up an error, as a number range that
falls within this new range already exists.
I hope this makes sense. The check needs to work whether a single or range
number is being entered.
Can someone tell me how in VBA I achieve this, please?
Would it also be possible for the msgbox alert to also advise which record
number is causing the problem? (assuming a standard autonumber for each
record).
Thanks for your help with this. I'm grateful for the efforts everyone puts
in here.
gb