I have no earthly idea where to start - I want to count using letters 
Author Message
 I have no earthly idea where to start - I want to count using letters

I'd like to write code that will 'count' using letters of the
 alphabet. I want to stick to upper case. Something
like...

A,B,C,D,E ... X,Y,Z,AA,AB,AC,AD ... AX,AY,AZ,BA,BB...
all the way thru ZZ.

I can handle the part where I write the values off to a
table field. I just can't figure out what kind of a loop
would produce this array. Any ideas?



Fri, 09 Sep 2005 01:29:00 GMT  
 I have no earthly idea where to start - I want to count using letters
Well, here's what I have so far...

Sub Button103_Click ()
'Asc("A")=65   Asc("Z")=90
Dim i As Integer, j As Integer, Posn1 As String, Posn2 As String

For j = 65 To 90
    Posn2 = Chr$(j)
    For i = 65 To 90
        Posn1 = Chr$(i)
        Debug.Print Posn2 & Posn1
    Next i
Next j

End Sub

However, this starts with AA, AB, AC, AD... I don't
know how to make it start with A, B, C, D, ... X, Y, Z
then go to AA, AB, AC, AD...

Ideas???
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Quote:

>I'd like to write code that will 'count' using letters of the
> alphabet. I want to stick to upper case. Something
>like...

>A,B,C,D,E ... X,Y,Z,AA,AB,AC,AD ... AX,AY,AZ,BA,BB...
>all the way thru ZZ.

>I can handle the part where I write the values off to a
>table field. I just can't figure out what kind of a loop
>would produce this array. Any ideas?



Fri, 09 Sep 2005 02:04:51 GMT  
 I have no earthly idea where to start - I want to count using letters
I can help you get started at least.
To get A...Z,
For I = 65 to 90
       Debug.Print Chr(I)
Next I
To get AA ...ZZ:
For I = 65 to 90
         For J = 65 to 90
                Debug.Print Chr(I) & Chr(J)
         Next J
Next I


Quote:
> I'd like to write code that will 'count' using letters of the
>  alphabet. I want to stick to upper case. Something
> like...

> A,B,C,D,E ... X,Y,Z,AA,AB,AC,AD ... AX,AY,AZ,BA,BB...
> all the way thru ZZ.

> I can handle the part where I write the values off to a
> table field. I just can't figure out what kind of a loop
> would produce this array. Any ideas?



Fri, 09 Sep 2005 02:04:28 GMT  
 I have no earthly idea where to start - I want to count using letters
Create TblLetter1 with the field Letter. Fill with the letters A to Z. Create
TblLetter2 with the field Letter. Make the first 26 records blank and then fill
with the letters A to Z. Now create a query based on the two tables but do not
join the tables so you get a cartesian product. Create one field in the query
with the expression:

LetterCombinations:TblLetter2.Letter & TblLetter1.Letter

Run the query and you will get all letter combinations from A to ZZ and AA, AB,
AC, etc will follow Z.

Turn the query into a make table query if you want to make a table of the letter
combinations.

--
                            PC Datasheet
A Resource for Access, Excel and Word Applications

                    www.pcdatasheet.com

Design and basic development for new applications
Additions, Modifications and "Fixes" for existing applications
Mentoring for do-it-yourselfers who want guidance
Complete application design and development
Applications Using Palm Pilot To Collect Data And
  Synchronize The Data Back To Access Or Excel


Quote:
> I'd like to write code that will 'count' using letters of the
>  alphabet. I want to stick to upper case. Something
> like...

> A,B,C,D,E ... X,Y,Z,AA,AB,AC,AD ... AX,AY,AZ,BA,BB...
> all the way thru ZZ.

> I can handle the part where I write the values off to a
> table field. I just can't figure out what kind of a loop
> would produce this array. Any ideas?



Fri, 09 Sep 2005 02:32:22 GMT  
 I have no earthly idea where to start - I want to count using letters
You didn't happen to try it yourself, did you? It sure didn't
work for me. Reading your post, it seems you want me
to create 2 tables, each with 52 records in them. Is that
right?

ccccccccccccccccccccccccccccccccccccccccccccccccccc

On Sun, 23 Mar 2003 18:32:22 GMT, "PC Datasheet"

Quote:

>Create TblLetter1 with the field Letter. Fill with the letters A to Z. Create
>TblLetter2 with the field Letter. Make the first 26 records blank and then fill
>with the letters A to Z. Now create a query based on the two tables but do not
>join the tables so you get a cartesian product. Create one field in the query
>with the expression:

>LetterCombinations:TblLetter2.Letter & TblLetter1.Letter

>Run the query and you will get all letter combinations from A to ZZ and AA, AB,
>AC, etc will follow Z.

>Turn the query into a make table query if you want to make a table of the letter
>combinations.



Fri, 09 Sep 2005 10:17:40 GMT  
 I have no earthly idea where to start - I want to count using letters
Yes, I tried it and it worked! Your tables are not correct!

<<Create TblLetter1 with the field Letter. Fill with the letters A to Z. >>
That would be 26 records in the first table.

In the second table, make sure you have twenty-six blank records and then 26
records with A to Z. That would be 52 records in that table.

Steve
PC Datasheet


Quote:
> You didn't happen to try it yourself, did you? It sure didn't
> work for me. Reading your post, it seems you want me
> to create 2 tables, each with 52 records in them. Is that
> right?

> ccccccccccccccccccccccccccccccccccccccccccccccccccc

> On Sun, 23 Mar 2003 18:32:22 GMT, "PC Datasheet"

> >Create TblLetter1 with the field Letter. Fill with the letters A to Z. Create
> >TblLetter2 with the field Letter. Make the first 26 records blank and then
fill
> >with the letters A to Z. Now create a query based on the two tables but do
not
> >join the tables so you get a cartesian product. Create one field in the query
> >with the expression:

> >LetterCombinations:TblLetter2.Letter & TblLetter1.Letter

> >Run the query and you will get all letter combinations from A to ZZ and AA,
AB,
> >AC, etc will follow Z.

> >Turn the query into a make table query if you want to make a table of the
letter
> >combinations.



Fri, 09 Sep 2005 11:08:29 GMT  
 I have no earthly idea where to start - I want to count using letters
Well, I'm a monkey's uncle. I tried and failed again.
Here's the SQL I'm using. I think I'm following your
instructions, but I must have something wrong...

SELECT DISTINCTROW [Letter2].[Letter] & [Letter2].[Letter] AS Hello
FROM Letter1, Letter2;

I've got 26 records in Table1 and 52 records in Table2.
All records in Table1 have values. The first 26 in Table2
are empty records.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

On Mon, 24 Mar 2003 03:08:29 GMT, "PC Datasheet"

Quote:

>Yes, I tried it and it worked! Your tables are not correct!

><<Create TblLetter1 with the field Letter. Fill with the letters A to Z. >>
>That would be 26 records in the first table.

>In the second table, make sure you have twenty-six blank records and then 26
>records with A to Z. That would be 52 records in that table.

>Steve
>PC Datasheet



>> You didn't happen to try it yourself, did you? It sure didn't
>> work for me. Reading your post, it seems you want me
>> to create 2 tables, each with 52 records in them. Is that
>> right?

>> ccccccccccccccccccccccccccccccccccccccccccccccccccc

>> On Sun, 23 Mar 2003 18:32:22 GMT, "PC Datasheet"

>> >Create TblLetter1 with the field Letter. Fill with the letters A to Z. Create
>> >TblLetter2 with the field Letter. Make the first 26 records blank and then
>fill
>> >with the letters A to Z. Now create a query based on the two tables but do
>not
>> >join the tables so you get a cartesian product. Create one field in the query
>> >with the expression:

>> >LetterCombinations:TblLetter2.Letter & TblLetter1.Letter

>> >Run the query and you will get all letter combinations from A to ZZ and AA,
>AB,
>> >AC, etc will follow Z.

>> >Turn the query into a make table query if you want to make a table of the
>letter
>> >combinations.



Fri, 09 Sep 2005 11:25:16 GMT  
 I have no earthly idea where to start - I want to count using letters
Oops... I posted the SQL wrong in the previous thread.
Here's what I'm using that I can't get to work...

SELECT DISTINCTROW [Letter2].[Letter] & [Letter1].[Letter] AS Hello
FROM Letter1, Letter2;
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Quote:

>Well, I'm a monkey's uncle. I tried and failed again.
>Here's the SQL I'm using. I think I'm following your
>instructions, but I must have something wrong...

>SELECT DISTINCTROW [Letter2].[Letter] & [Letter2].[Letter] AS Hello
>FROM Letter1, Letter2;

>I've got 26 records in Table1 and 52 records in Table2.
>All records in Table1 have values. The first 26 in Table2
>are empty records.

>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

>On Mon, 24 Mar 2003 03:08:29 GMT, "PC Datasheet"

>>Yes, I tried it and it worked! Your tables are not correct!

>><<Create TblLetter1 with the field Letter. Fill with the letters A to Z. >>
>>That would be 26 records in the first table.

>>In the second table, make sure you have twenty-six blank records and then 26
>>records with A to Z. That would be 52 records in that table.

>>Steve
>>PC Datasheet



>>> You didn't happen to try it yourself, did you? It sure didn't
>>> work for me. Reading your post, it seems you want me
>>> to create 2 tables, each with 52 records in them. Is that
>>> right?

>>> ccccccccccccccccccccccccccccccccccccccccccccccccccc

>>> On Sun, 23 Mar 2003 18:32:22 GMT, "PC Datasheet"

>>> >Create TblLetter1 with the field Letter. Fill with the letters A to Z. Create
>>> >TblLetter2 with the field Letter. Make the first 26 records blank and then
>>fill
>>> >with the letters A to Z. Now create a query based on the two tables but do
>>not
>>> >join the tables so you get a cartesian product. Create one field in the query
>>> >with the expression:

>>> >LetterCombinations:TblLetter2.Letter & TblLetter1.Letter

>>> >Run the query and you will get all letter combinations from A to ZZ and AA,
>>AB,
>>> >AC, etc will follow Z.

>>> >Turn the query into a make table query if you want to make a table of the
>>letter
>>> >combinations.



Fri, 09 Sep 2005 11:34:31 GMT  
 I have no earthly idea where to start - I want to count using letters
Here's my SQL that works fine.

SELECT [TblLetter2].[Letter] & [TblLetter1].[Letter] AS Hello
FROM TblLetter1, TblLetter2;

I also tried adding DistinctRow to my SQL and it worked fine.

Explain what you mean when you say you can't get it to work.

Steve


Quote:
> Oops... I posted the SQL wrong in the previous thread.
> Here's what I'm using that I can't get to work...

> SELECT DISTINCTROW [Letter2].[Letter] & [Letter1].[Letter] AS Hello
> FROM Letter1, Letter2;
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


> >Well, I'm a monkey's uncle. I tried and failed again.
> >Here's the SQL I'm using. I think I'm following your
> >instructions, but I must have something wrong...

> >SELECT DISTINCTROW [Letter2].[Letter] & [Letter2].[Letter] AS Hello
> >FROM Letter1, Letter2;

> >I've got 26 records in Table1 and 52 records in Table2.
> >All records in Table1 have values. The first 26 in Table2
> >are empty records.

> >xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

> >On Mon, 24 Mar 2003 03:08:29 GMT, "PC Datasheet"

> >>Yes, I tried it and it worked! Your tables are not correct!

> >><<Create TblLetter1 with the field Letter. Fill with the letters A to Z. >>
> >>That would be 26 records in the first table.

> >>In the second table, make sure you have twenty-six blank records and then 26
> >>records with A to Z. That would be 52 records in that table.

> >>Steve
> >>PC Datasheet



> >>> You didn't happen to try it yourself, did you? It sure didn't
> >>> work for me. Reading your post, it seems you want me
> >>> to create 2 tables, each with 52 records in them. Is that
> >>> right?

> >>> ccccccccccccccccccccccccccccccccccccccccccccccccccc

> >>> On Sun, 23 Mar 2003 18:32:22 GMT, "PC Datasheet"

> >>> >Create TblLetter1 with the field Letter. Fill with the letters A to Z.
Create
> >>> >TblLetter2 with the field Letter. Make the first 26 records blank and
then
> >>fill
> >>> >with the letters A to Z. Now create a query based on the two tables but
do
> >>not
> >>> >join the tables so you get a cartesian product. Create one field in the
query
> >>> >with the expression:

> >>> >LetterCombinations:TblLetter2.Letter & TblLetter1.Letter

> >>> >Run the query and you will get all letter combinations from A to ZZ and
AA,
> >>AB,
> >>> >AC, etc will follow Z.

> >>> >Turn the query into a make table query if you want to make a table of the
> >>letter
> >>> >combinations.



Sat, 10 Sep 2005 09:58:11 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Counting records starting with a letter.

2. Using letter to count like binary

3. Problem starting Acces 97 after having started Outlook 2000

4. Combo box ideas wanted!

5. combo box ideas wanted

6. Table Structure Ideas wanted (was Error message 3022)

7. Combo box ideas wanted!

8. Ideas wanted, I think its an easy one(people in projects):

9. Reposted w/ email: Ideas wanted, easy one (people in project)

10. Help wanted or ideas!


 
Powered by phpBB® Forum Software © phpBB Group