Link to home
Start Free TrialLog in
Avatar of Candace Hagood
Candace HagoodFlag for United States of America

asked on

assign a range of numbers in access 2003

Hi. wonder if possible.  Have a db.  have a form with a subform (datasheet view of a query).  This subform may contain 10 items or it may contain more ie up to 100.  The user needs to enter a range of numbers in a textbox ie 1-100 and have the numbers be assigned/distributed across the 100 records in the subform. Doesn't matter what order they land in as long as each only get one number and none have the same.  is this possible?  
Avatar of Candace Hagood
Candace Hagood
Flag of United States of America image

ASKER

any help.  anyone????
Avatar of puppydogbuddy
puppydogbuddy

see if this link and free download comes close to what you want:
         http://support.microsoft.com/kb/210340
ASKER CERTIFIED SOLUTION
Avatar of Helen Feddema
Helen Feddema
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Here is a screen shot of the form:
Assign-Number-form.jpg
So, we have machines but users have to create a line of (up to) 100 unique numbers... If you simply use autonumber field it will do the work for you.
If users must enter these numbers why they cannot enter them directly into the data grid? Uniqueness can be handled by unique index.
I think we might benefit from further explanation of "The user needs to enter a range of numbers in a textbox ie 1-100"

I am not so sure it means that the user is going to enter 100 different numbers - or does it ?

if entering (literally)  "1-10"  does that mean select 10 rows and make sure that have a unique number ?

If extracting rows from a detailed table, then ideally use the autonumber facility - so long as the table that you might use to source that column does provide you with unique rows in your query, then just use the select TOP nn * from datasource, or, could use a subquery (or function) to get a count of rows lesser than the current row - bit of a performance overhead, and there are a couple of other ways as per suggestions above.

Anyway, if you could please provide a quick explanation / detail your requirement a bit more, it would help a lot...

Autonumbers would work unless the numbers need to be overwritten (as I assumed in my sample code), or if they are actually meaningful numbers entered by the users (not clear from the initial question).  More information would indeed be helpful here.
>>any help.  anyone????<<
Any feedback????
Hey all, sorry just got back in office from a much need holiday break.  Helen thank you so much.  I think this will work trying this morning.   The reason i like this approach is because the numbers may be 50-80 or 1870-1890 etc.  there is no telling. and our users like things in one place.  to much manual work and things get ...complicated. Let me try and will get let you know.