if [field]="A" then [field1] = "B"

  • Thread starter msnnews.microsoft.com
  • Start date
M

msnnews.microsoft.com

Does any one know if there an easy way to get access
to automatically assign the next letter of the alphabet without
using lots of if then statements in VBA.

Thanks
Matt
 
D

Douglas J. Steele

Assuming that the letter is stored in a variable strLetter, try

Chr$(Asc(strLetter) + 1)

(This will, of course, give a non letter if strLetter is Z or z!)
 
F

Fernando

Use the 'IIF' formula to set the value to "A" when strLetter is "Z".

Just another thing...
if you're not using vba at all, and it's a form with some textboxes what you
want, put the same formula Douglas wrote in the defalut value of the textbox
where you want the result to be read, changing 'strletter' for the name of
the TB where the 1st letter is.
 

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