Page 1 of 4 123 ... LastLast
Results 1 to 15 of 47

Thread: Help

  1. #1
    Join Date
    Nov 2002
    Posts
    50

    Question Unanswered: Help

    Hi everyone

    I have to make a report based on different year. This report as animal names as column headings. and then City's by Row heading.

    I have a table called Animal. its got cities and animal names and dates.

    I have everything working. It makes the report depending on what year the user want the report based on. With all the animal names at the top as collum headings. and cities and Row heading.

    But some of the animal names are too big. So I made a query in which it would take the first three letters of the animal (for example TIGER AS TIG) and then colon and then the full name (it woud look something like that (TIG: TIGER).So What I did is I took the first 3 letters of the animal names and put it at the top of the Report( for example if the animal name is "TIGER" i took "TIG") . and right at the bottom of the report I put abbreviations as the whole name (for example TIG: TIGER). To explain the user wat those three letter means. This way everything would fit on one page.


    Know the problem is that lets say the animal name is SNAKE so it would take SNA but again there's an animal and its name is SNAIL so it would take SNA again. and at the top of the report in the column heading i would see two "SNA"s. I dont want that. Do you guys have any ideas how to fix this problem?
    Deep

  2. #2
    Join Date
    Feb 2002
    Posts
    403
    Vertical column headings

  3. #3
    Join Date
    Nov 2002
    Posts
    50
    vertical column headings?

    sorry wat u mean by that?


    Originally posted by dynamictiger
    Vertical column headings
    Deep

  4. #4
    Join Date
    Feb 2002
    Posts
    403
    Have a look at the propertys for your text boxes you may have the ability to make them vertical instead of horizontal. If all else fails you could change the column headings to Labels which definitely allow vertical. In thsi way the entire name can fit just up down instead of across.

  5. #5
    Join Date
    Nov 2002
    Posts
    50

    Unhappy

    No my boss dont want it like that. They want the first three letter at the top and then the abbreviations at the bottom

    Originally posted by dynamictiger
    Have a look at the propertys for your text boxes you may have the ability to make them vertical instead of horizontal. If all else fails you could change the column headings to Labels which definitely allow vertical. In thsi way the entire name can fit just up down instead of across.
    Deep

  6. #6
    Join Date
    Feb 2002
    Posts
    403
    That is a political problem.

  7. #7
    Join Date
    Nov 2002
    Posts
    50
    LOL

    well it wouldn't work like that. cause i also have the totals at the bottom and they're huge. i don't think total would look good vertically at the bottom

    any other ideas??

    Originally posted by dynamictiger
    That is a political problem.
    Deep

  8. #8
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    the only simple solution is for you to enter the 3 letter aberviavsion your self, but if your set on this course if you don't mind a few abbreviasions less that 3 letters you could screen out 'a','e','i','o' & 'u' and then take the first 3 letters os snail becomes 'SNL' and Snake 'SNK' rat though would be 'RT' and eel 'L'

    and if you wanted to take this even further do the above then test the lenght if it's less that 3 get the first 3 letters of the original name

    something like:
    Code:
    Function ab() As String
        Dim Vowels(5) As String, Name As String, temp As String
        Dim Test As Boolean
        Test = False
        Vowels(1) = "A"
        Vowels(2) = "E"
        Vowels(3) = "I"
        Vowels(4) = "O"
        Vowels(5) = "U"
        Name = animalname
        
        While Not Test
            Test = True
            For i = 1 To 5
                temp = Name
                Name = (Left$(Name, InStrRev(Name, Vowels(i)) - 1) & _
                Right$(Name, Len(Message) - InStrRev(Message, vowel(i))))
                If (Name <> temp) Then Test = False
            Next i
        Wend
        If (Len(Name) < 3) Then ab = Left$(animalname, 3) _
        Else ab = Left$(Name, 3)
        
    End Function
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  9. #9
    Join Date
    Nov 2002
    Posts
    50
    It's giving me an error when it doesn't find any vowel in it.



    Originally posted by m.timoney
    the only simple solution is for you to enter the 3 letter aberviavsion your self, but if your set on this course if you don't mind a few abbreviasions less that 3 letters you could screen out 'a','e','i','o' & 'u' and then take the first 3 letters os snail becomes 'SNL' and Snake 'SNK' rat though would be 'RT' and eel 'L'

    and if you wanted to take this even further do the above then test the lenght if it's less that 3 get the first 3 letters of the original name

    something like:
    Code:
    Function ab() As String
        Dim Vowels(5) As String, Name As String, temp As String
        Dim Test As Boolean
        Test = False
        Vowels(1) = "A"
        Vowels(2) = "E"
        Vowels(3) = "I"
        Vowels(4) = "O"
        Vowels(5) = "U"
        Name = animalname
        
        While Not Test
            Test = True
            For i = 1 To 5
                temp = Name
                Name = (Left$(Name, InStrRev(Name, Vowels(i)) - 1) & _
                Right$(Name, Len(Message) - InStrRev(Message, vowel(i))))
                If (Name <> temp) Then Test = False
            Next i
        Wend
        If (Len(Name) < 3) Then ab = Left$(animalname, 3) _
        Else ab = Left$(Name, 3)
        
    End Function
    Deep

  10. #10
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    sorry about this, but i converted the method from something else and forgot to change somethings like the variable name 'message' should be 'name' so here's take 2 with a testing sub

    Code:
    Sub test()
        MsgBox ab("rat")
        MsgBox ab("cat")
        MsgBox ab("elephant")
        MsgBox ab("gunu")
        MsgBox ab("larma")
    End Sub
    
    Function ab(animalname As String) As String
        Dim Vowels(5) As String, Name As String, temp As String
        Dim test As Boolean
        Dim i As Integer
        test = False
        Vowels(1) = "A"
        Vowels(2) = "E"
        Vowels(3) = "I"
        Vowels(4) = "O"
        Vowels(5) = "U"
        Name = animalname
        
        While Not test
            test = True
            For i = 1 To 5
                temp = Name
                If InStrRev(Name, Vowels(i)) <> 0 Then
                    Name = (Left$(Name, InStrRev(Name, Vowels(i)) - 1) & _
                    Right$(Name, Len(Name) - InStrRev(Name, Vowels(i))))
                    If (Name <> temp) Then test = False
                End If
            Next i
        Wend
        If (Len(Name) < 3) Then ab = Left$(animalname, 3) _
        Else ab = Left$(Name, 3)
        
    End Function
    fully tested
    Last edited by m.timoney; 11-22-02 at 09:37.
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  11. #11
    Join Date
    Nov 2002
    Location
    The Netherlands
    Posts
    61
    Maybe with an if , a for and left,mid?

    and then test if you got the same 3 letters if so take 4th letter if 4th letter is taken take the fifth?

  12. #12
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    i would point out that though this is better than the first 3 letters it isn't fool proof try 'bulldog' and 'bull' and you'll see 'bll' for both
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  13. #13
    Join Date
    Nov 2002
    Location
    The Netherlands
    Posts
    61
    Ehm Bull wont be shown:P maybe if your at the last letter of a word it and their still the same take the other word and change it.

  14. #14
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    typo ment bullfrog, and that wasn't a reply about your method, as i was still typing it when you posted
    Last edited by m.timoney; 11-22-02 at 10:05.
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  15. #15
    Join Date
    Nov 2002
    Location
    The Netherlands
    Posts
    61
    Not if you keep going on until you get a good one if your on the end of the word take the other and take the word thats a bit further.

    Like bullfrog and bull :P

    You alreay have bul, but its from bullfrog. Change bul(bullfrog) to buf then change bull to bul. Something like that?
    But you need a bunch of fors and ifs

    For 1 = The one that gets the values from all the animals
    For 2 = The other that gets the values from the headings that are made to test
    For 3 = The one that checks the letters starting at 3
    If 1 = for the test between heading(The new one with the 3 letters from other animals) and the one your at 3 letters

    Is my guess. Dont have code yet. What are your variables
    Last edited by DeathWing; 11-22-02 at 10:27.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •