473,407 Members | 2,326 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,407 software developers and data experts.

Enter a range of values into a table with other values

I am using Access 2007. I created a serial number database that imports excel into a table. I have now been asked if they can import a range of numbers directly into access. I have a single entry form which works but how do I do it for a range of serial numbers and include some values that don't change?
Here is an example of what they want to do:
Serial number range: abc123 - abc456
Part Number: A234J1
PO Number: 5008
DateEntered: 3/10/2010

Part numbers are in their own table and those won't change much and if they do they can be entered on their own existing form - but these need to be verified against the part number table so make sure they are correct
The rest of the fields are all in a serialnumber table.

Serial numbers are of course unique and if there was a pop up that said one of them being entered is already used that would be a bonus.

Thanks!
Mar 10 '10 #1
11 2605
NeoPa
32,556 Expert Mod 16PB
This could be clearer. Are you saying that you would want, from your example :
Expand|Select|Wrap|Line Numbers
  1. SerialNo    PartNo    PONo    Date Entered
  2. abc123      A234J1    5008    3/10/2010
  3. abc124      A234J1    5008    3/10/2010
  4. ...
  5. abc454      A234J1    5008    3/10/2010
  6. abc456      A234J1    5008    3/10/2010
Mar 10 '10 #2
Yes that's exactly what I'm looking for. There are a couple other fields to be added but I can do those once I get an example.

Thanks.
Mar 10 '10 #3
NeoPa
32,556 Expert Mod 16PB
You'd need to be clearer about which characters are allowable in your sequence and which parts of the value should be considered as sequencing and which parts static. For instance, what about abc123 to def456? Would the last three characters be limited to simple digits but the 1st 3 characters be limited to alpha characters? That would be my guess, but hasn't been stated anywhere. It would have a completely different outcome if the whole ASCII range were included.

Whatever the rules are, you're likely to need a loop in your code that goes through all the possible variants between the two values specified. For each iteration a record would need to be added. This can be done either using Recordset processing (Access VBA DAO Recordset Loop Using Two Recordsets), or an INSERT INTO query can be executed with the required values.

There is nothing I'm aware of in SQL that allows you to add a range of records in a single instruction I'm afraid.
Mar 10 '10 #4
There are no limits on what the serial numbers can be as they are given to us by our supplier. no character limits, no validation data other than they can't be used again if they are already in the table.
They could be 1b123 or 123AGK32J2. No limits other than not more than 15 characters and a-z,A-Z and 0-9.
Mar 10 '10 #5
NeoPa
32,556 Expert Mod 16PB
So, for your example (abc123 - abc456), instead of there being 333 records in the sequence, there are actually 11,721? Is that what you're saying?

You won't get anywhere close to getting the code to work properly until you have this detail thoroughly understood.
Mar 10 '10 #6
It could be up to 500 different serial numbers in some kind of sequence. Don't now what that sequence is until they are issued to us by the vendor. The example abc123 is probably too short. I think they are currently using about 10 characters in some type of sequence. Ranges could be 10 or 100 or 400 no idea or control over that part. I can see why this could be a programming issue not knowing how many characters or how many numbers.
Does that make sense?
Mar 11 '10 #7
NeoPa
32,556 Expert Mod 16PB
It makes sense I suppose, but you still need to sort it out before you can think of starting to code up the logic.
Mar 11 '10 #8
Not sure what else to sort out. I don't have any more specifics as they come from someone else out of my control and can change with the next batch they issue.
How about entering the fixed part (1b23) then enter the range (200-400) to append on the end? It could also be 1b23 then a45-d90.
I can try and ask the vendor tomorrow if they have more to give me for specs.
Mar 11 '10 #9
NeoPa
32,556 Expert Mod 16PB
Sounds like a plan. Specs are like the base of a pyramid to a project. Something everything else rests upon. Unless that is sorted out entirely robustly the structure will crumble. Code doesn't work like humans do. It can't think for itself, that must be done in the logic before it runs, and if the logic isn't finitely and clearly stated the code won't even get to first-base.
Mar 11 '10 #10
The most I info I can get is that the text part (abc) won't ever change for a particular batch. They will change the number part (100-200) part. So if the end-user can key in the abc then a range of numbers and have those increased and joined together I think that would work. abc100, abc101...abc199, abc200

Just my thoughts on it.
They will also be keying in static info - POnumbers, date, order#, part#, etc. Those won't change for the entire batch input.
Does that make more sense?
Thanks!
Mar 11 '10 #11
NeoPa
32,556 Expert Mod 16PB
Yes it does. That takes us back to the state we were in after you confirmed my understanding of post #2.

In that case you'd want three controls on your form. One each for Base Alpha, Start Numeric Sequence and End Numeric Sequence.

This would then take you back to the second paragraph of post #4. I believe the instructions there are now appropriate and will enable you to proceed with getting this done. Let us know if you have any further problems, or better yet, that you've successfully built the code to do the job.

Good luck. We're here if you need us further.
Mar 11 '10 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Dan | last post by:
I am a relatively new user on Oracle 9.2.0.1 and I am having trouble performance tuning this production database. I am running a large query that joins two tables, document(3 mil) and entity(9...
5
by: ratu | last post by:
I'd like to use a stored procedure to insert large amounts of records into a table. My field A should be filled with a given range of numbers. I do the following ... but I'm sure there is a better...
4
by: Jorey Bump | last post by:
I can retrieve today's date: mysql> SELECT CURDATE() AS begin; +------------+ | begin | +------------+ | 2005-06-01 | +------------+ 1 row in set (0.00 sec)
7
by: Thomas R. Hummel | last post by:
Hello all, I am trying to write a query that compares a member's enrollment period with the products that their group has had during that period (all members belong to a group and the products...
5
by: serge | last post by:
How can i enter Default Values of " " to all the columns of type character of all the tables (excluding system tables) and Default Values of 0 of all columns of type numbers. Excluding all primary...
10
by: Robert | last post by:
I would like to run a report for each month over two years. I am currently using a date range like this. Then manually substitute the error_time bounds for each month and rerun the query. How...
5
by: sameer_deshpande | last post by:
Hi, I need to create a partition table but the column on which I need to create a partition may not have any logical ranges. So while creating or defining partition function I can not use any...
2
by: No bother | last post by:
I have a table such as below: BreakID StartTime EndTime 1 08:00:00 10:00:00 2 08:00:00 10:30:00 3 08:00:00 11:00:00 4 08:30:00 11:00:00 What I need to find are the whole clock hours...
1
by: miller.brettm | last post by:
Hello, I'm getting the following error message when I try add a row using a Stored Procedure. "The identity range managed by replication is full and must be updated by a replication agent". ...
3
by: haelly | last post by:
Write a program that prompts the user to enter three different integer values.If the values are not different, the program prints a message"equal values" and terminates(hint: use the return...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...

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.