Need help in the setup of an Anime Listing Database

T

The Freshman

Ok, I have it mostly setup in Access 2000. My problem has
to do with listing the episodes I have of a series.
Example, if I have only episodes 1 through 5, 13, and 16
out of a 26 episode series, then how do I set up the
database so that I can just input the numbers I have along
with the known total so that when I input it into the form
it will understand I have "1-5, 13, 16."

The idea is to step the database so that someone else
could input what episodes they have on there list and I
can have my own and yet combine them as two seperate
entities that would list what we have as a whole and what
we are both missing. In one place but be able to find out
who has what I am missing so I can ask to get it from him.

Now, if I can set up the system so that if a person
inputs "1-5, 13, 16" that the database understands that 1-
5 means 1,2,3,4,5 without having to type it out. Its like
what a person would do to tell MICROSOFT WORD to print out
only select pages just in this case to store that data and
create the database required.

Please help me out! Thank YOU!
 
T

Tim Ferguson

Example, if I have only episodes 1 through 5, 13, and 16
out of a 26 episode series, then how do I set up the
database so that I can just input the numbers I have along
with the known total so that when I input it into the form
it will understand I have "1-5, 13, 16."

No built-in methods that I know of: it looks like a piece of VBA to chunk
out the separate parts. I think I would do something like a looP

While Len(TheString) >0 ' bug out when it's finished

' get everything up to a comma or space
' and remove it from the front of the string
TheToken = GetAToken(TheString)

If IsANumber(TheToken) Then
' it's just one number
StorePageNumber(TheToken)

ElseIf IsARange(TheToken) Then
' it's ## to ##
For TheNumber = LowerEnd(TheToken) to UpperEnd(TheToken)
StorePageNumber (TheNumber)

Else
' it's malformed
Err.Raise "Error in string entered by user"

End If

Loop

The functions LowerEnd and UpperEnd will need to be able to decide what to
do with partial ranges like "-3" or "12-" (note that MS Word print doesn't
always handle these nicely!), presumably by getting the AbsoluteMax and
AbsoluteMin from somewhere. Or else you could reject them using IsARange.

Hope that helps

Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top