Populating a schedule from my data and appending it to a table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • josephsimonbenn
    New Member
    • Apr 2010
    • 32

    #31
    sure but some functions may not work... i'll do it now :)

    Comment

    • josephsimonbenn
      New Member
      • Apr 2010
      • 32

      #32
      Here is the latest version....

      Here goes!! x
      Attached Files

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #33
        You had a couple of problems primarily with the List Box and the Requerying of it. There also appeared to be errant code in some of the Modules, but you should be OK now. Good Luck.
        Attached Files

        Comment

        • josephsimonbenn
          New Member
          • Apr 2010
          • 32

          #34
          Its all great except some dates still come the wrong way round on some records!!! ahha. Everything else is awesome, though dude!! Serious thanks!!! I duno what i can do about the date thing! x

          Comment

          • ADezii
            Recognized Expert Expert
            • Apr 2006
            • 8834

            #35
            1. Remove any Formatting from the [Date] Field in tblResults.
            2. Change Code Line #10 in fPopulateSchedu le() as indicated below:
              Code:
              '...Code intentionally omitted
              'Populate tblResults with the Cycle, Day in Cycle, and Random Days in Cycle
              For intCycleCounter = 1 To bytNumOfCycles
                For intDaysInCycleCtr = 1 To bytDaysInCycle
                  For intArrayCtr = LBound(varRandoms) To UBound(varRandoms)
                    'Does the Day in the Cycle equal the Random Date?
                    If intDaysInCycleCtr = varRandoms(intArrayCtr) Then
                      CurrentDb.Execute "INSERT INTO tblResults ([Cycle], [Day], [Date], [Patient], [ChmoPackageID], [Regimen]) VALUES (" & _
                                         intCycleCounter & ", " & intDaysInCycleCtr & ", #" & _
                                         Format(DateAdd("d", intOverallDayCtr, dteDate), "mm/dd/yyyy") & "#, '" & strCustomer & _
                                         "', " & lngPackageID & ", '" & strQuickName & "');", dbFailOnError
                    End If
                  Next
                    Debug.Print Format(DateAdd("d", intOverallDayCtr, dteDate), "dd/mm/yyyy")
                    intOverallDayCtr = intOverallDayCtr + 1
                Next
              Next
              '...Code intentionally omitted
            3. All Results will be correctly displayed but in the dd/mm/yyyy Format as opposed to mm/dd/yyyy.
            4. A query can always Re-Format the [Date] Field if you so desire, and also be the RowSource for the list Box, as in:
              Code:
              SELECT tblResults.Cycle, tblResults.Day, Format(tblResults.Date, "dd/mm/yyyy") As FDate,
               tblResults.Patient, tblResults.ChmoPackageID, tblResults.Regimen FROM tblResults;
            5. See Attachment below for Date Problem Correction:
            Attached Files

            Comment

            • josephsimonbenn
              New Member
              • Apr 2010
              • 32

              #36
              Wow - amazingggg - all works great!! Thank you so much you're a genius!!

              Stay tuned... more difficult questions on the way!!!

              Comment

              • ADezii
                Recognized Expert Expert
                • Apr 2006
                • 8834

                #37
                Originally posted by josephsimonbenn
                Wow - amazingggg - all works great!! Thank you so much you're a genius!!

                Stay tuned... more difficult questions on the way!!!
                Glad to help you - how about giving me a break before any more difficult questions? (LOL). This Thread was really a challenge, but we pulled through.

                Comment

                • josephsimonbenn
                  New Member
                  • Apr 2010
                  • 32

                  #38
                  lol u can have a break.... i realli appreciate it!!!

                  Only one thing i wish i'd have asked for is that that another field is added and it increments like so....

                  for example - Cycle Day [New Field]
                  1 1 A
                  1 8 B
                  1 15 C
                  2 1 A
                  2 8 B
                  2 15 C

                  Haha when you fancy a challenge next!!

                  Comment

                  • ADezii
                    Recognized Expert Expert
                    • Apr 2006
                    • 8834

                    #39
                    Originally posted by josephsimonbenn
                    lol u can have a break.... i realli appreciate it!!!

                    Only one thing i wish i'd have asked for is that that another field is added and it increments like so....

                    for example - Cycle Day [New Field]
                    1 1 A
                    1 8 B
                    1 15 C
                    2 1 A
                    2 8 B
                    2 15 C

                    Haha when you fancy a challenge next!!
                    Happened to be very slow at work, and this was a relatively simple request. Here goes:

                    P.S. - I now consider this Thread closed.
                    Attached Files

                    Comment

                    Working...