- Joined
- Jul 9, 2011
- Messages
- 4
- Reaction score
- 0
Hi
I have a three part question. I am somewhat familiar with VBA and SQL but not with Access at all. What I am trying to do is take one table of all letters and copy that to a new table incrementing each letter by one. I understand I need to create a function under modules and call that from macro but my head is spinning and I could use some help.
I found the function below that I believe will help with the incrementing by 1 letter. But I am having trouble getting to the next step.
[FONT="]So I need to take the contents of tblLetters and creates a new table with the next letter. For example, the first row of the newly created table will contain B-C-D-E-F, instead of A-B-C-D-E, and the second row will contain G-H-I-J-K, instead of F-G-H-I-J, and so on. Where Z resets to A. [/FONT]
Thanks in advance for any advice or links.
I have a three part question. I am somewhat familiar with VBA and SQL but not with Access at all. What I am trying to do is take one table of all letters and copy that to a new table incrementing each letter by one. I understand I need to create a function under modules and call that from macro but my head is spinning and I could use some help.
I found the function below that I believe will help with the incrementing by 1 letter. But I am having trouble getting to the next step.
Code:
Public Function AutoIncrement(LetterIn As String) As String
Dim NumLetterIn As Integer
NumLetterIn = Asc(LetterIn)
If NumLetterIn = 90 Then
AutoIncrement = "A"
Else
AutoIncrement = Chr(NumLetterIn + 1)
End If
Thanks in advance for any advice or links.