Paul,
 
    Function named Fn_NextElevenMonths() as given below, returns an array of the names of next eleven months following the name of month supplied as an argument.
 
    Sample db named Funnction_NextElevenMonths_2K.zip, uploaded to Files section of this group, demonstrates its implementation for populating the text boxes as sought by you.
 
Best wishes,
A.D.Tejpal
 
===================================
Function Fn_NextElevenMonths(ByVal _
                        ThisMonthName As String) As Variant
    ' Returns An Array of the names of next eleven months
    ' (following ThisMonthName).
    Dim MonthArray As Variant, Cnt As Long
    Dim MonthNum As Long, Ctr As Long

   
    ' Get MonthNum for This Month
    For Cnt = 1 To 12
        If MonthName(Cnt, True) = Left(ThisMonthName, 3) Then
            MonthNum = Cnt
            Exit For
        End If
    Next

   
    ' Build the month array
    ReDim MonthArray(11)
    For Cnt = MonthNum + 1 To MonthNum + 11
        Ctr = IIf(Cnt <= 12, Cnt, Cnt - 12)
        MonthArray(Cnt - MonthNum) = _
                                MonthName(Ctr, True)
    Next
   
    Fn_NextElevenMonths = MonthArray
 
End Function
===================================
 
----- Original Message -----
From: wartheit
Sent: Thursday, September 08, 2005 03:10
Subject: [AccessDevelopers] Autofill text boxes

Hello,

I am trying to design a form to record the dates we receive reports from our clients. I have 12 text boxes set up to hold the name of each reporting month. I would like to have all 12 text boxes filled with the names of consecutive months after the name of the first month is entered.
For example, if month 1 is April, then months 2 through 12
would autofill in with May, June, July, ... March. If month 1 is
October, then months 2 through 12 would autofill November,
December,... September. (I hope this is clear. I'm working off some vacation sleepiness).

I've thought of some nested "IIF ... Then" statements, but that would be a lot of coding. Does anyone have any thoughts about how I could do this? A Lookup table of some kind??

Thanks in advance.

Paul W.



Please zip all files prior to uploading to Files section.




SPONSORED LINKS
Microsoft access developer Microsoft access help Microsoft access database
Microsoft access training Microsoft access training course Microsoft access programming


YAHOO! GROUPS LINKS




Reply via email to