Form help again!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a text box month id in my form. When I am making a report, I want
month to come out as a number so I can sort them. Is there a way to put an
if statement in there in VBA or somethin else to where I can say for example,
If month=January in my table, then month id =1?
thx
Jimmy
 
Where you put this code will depend on where you want to derive this number.

Dim lngX as Long
For lngX = 1 to 12
If MonthName(lngX) = Me.MyMonthTextBox Then
SomeVariableOrControl = lngX
Exit For
End If
Next lngX
 
Back
Top