View Single Post
  #6  
Old August 11th, 2004, 04:50 PM
tina
external usenet poster
 
Posts: n/a
Default How to phrase If/Then clauses in the control source field

hon, you don't give nearly enough specific information for someone to
provide you with a specific solution. even now, you said you got an error
message, but didn't provide specific details.
assuming that Sco's assumptions about your specifics are correct (and since
he obviously read the previous thread and i didn't), he gave you very
specific and correct instructions - and good advice. hopefully you'll find
both instructions and advice helpful. good luck.


wrote in message
...
I tried it but it gave me a syntax error message. Is
there a general if/then template?
-----Original Message-----
Dim intYear As Integer
intYear = Left(CodeString, 1)
Select Case intYear
Case 6 To 9
FieldOrVariable = 1990 + intYear
Case 0 To 5
FieldOrVariable = 2000 + intYear
End Select

you'll have to tweak it to work in your specific

circumstances, but that
should get you started.

hth


wrote in message
...
Hello,
This is a continuation of an earlier thread

about
Parsing strings from one field into many. I making a
database,that contains five fields of overlap and to

make
the data entry easier I am trying to automate some of

it.
I have a code field, and then four other fields whose
information can be derived from the code ((codelooks

like
this: 01MP, and has four parts. The first number refers
to the year 2000, the second number refers the season

of
the year (spring), the third to type of media (a
magazine), and the fourth the genre (politics).))

Anyway,
my problem lies in the fact that the code only has one
digit for the year, and the time span is from 1996 to
present. so how could one phrase an expression that
essentially says: if the first digit of the code string
is =6 but =9, add the value to 1990, and if the value
is =0 but =5 add it to 2000 (a short term solution;

the
code thing will eventually be revised). Thanks for any
help or info you can provide!



.