MS Access Calendar - trying to implement changes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dana Lee
    New Member
    • Jan 2013
    • 2

    MS Access Calendar - trying to implement changes

    I have been wrestling with this for several days (well. and several other forms I am tring to connect to tables etc.) I have taken the calendar form the database offered back in 2010 but I do not need the start time and end time fields - but before I can change the table I need to get them out of the VB and it seems that they must be within some term?

    I do not pretend to be an Access Expert, I am a BSA and expected to know everything - this one elludes me!!

    Please Assist??
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    Dana,
    Your question is (imho) somewhat along the lines of "stream of consciousness"

    Would you please take a deep breath and start over?
    What we need is for you to clearly state what your project goal is.
    What you have attempted.
    What has/is happening... and how that differs from what you want to have happen.
    Any errors... PLEASE, PLEASE, post the EXACT title, number, and text. Paraphrased error messages are often misleading.

    The pertinent portions of your VBA code would also be most helpful... please remember to use the <CODE/> button in the above toolbar to format any posted code.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32663

      #3
      Dana, having been here longer than many other experts I can see you may be referring to the thread - MS Access Calendar. It is not reasonable though, to expect experts to know what you mean by a simple, non-hyperlink, reference.

      Like Z, I'd like to assist, but following your question is not remotely easy, and if I don't even understand the question I'm not well-placed to offer any assistance. Z has already laid out how to make yourself much better understood.

      Comment

      • Dana Lee
        New Member
        • Jan 2013
        • 2

        #4
        Okay, I had attached my VBA which you are correct, is the same used in what was/is on this site as MS Access Calendar, I believe the last who did changes to it was your site's ADenzii. I have gone through the code painstakingly numerous times attemptin gto remove all references to the [Start Time] or [End Time]and get all sorts of error messages. Partiularly when I remove it from an SQL statement:
        Code:
        strSQL = "Select Training_Events.Title, Training_Events.[Start Date], Training_Events.[End Date], " & _
                 "Training_Events.[Start Time] From Training_Events Where Training_Events.[Start Date] " & _
                 "Between " & lngFirstOfMonth & " And " & lngLastOfMonth & _
                 " or Training_Events.[End Date] Between " & lngFirstOfMonth & " And " & lngLastOfMonth & _
                 " or (Training_Events.[Start Date] < " & lngFirstOfMonth & _
                 " and Training_Events.[End Date] > " & lngLastOfMonth & ")" & _
                 " ORDER BY Training_Events.[Start Date], Training_Events.[Title];"
        I did an attachedment of the entire code on my original post. I thought the change would be simple but this has me going nuts!

        -Dana Lee
        Last edited by NeoPa; Jan 23 '13, 09:35 PM. Reason: [Z{Please use the <CODE/> button to format posted code/html/sql}][NeoPa{Fixed the problem with the tags Z added :-D}]

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32663

          #5
          Originally posted by Dana
          Dana:
          I did an attachedment of the entire code on my original post. I thought the change would be simple but this has me going nuts!
          I'm confused. There is no attachment in post #1 and no flag indicating it's been edited since it was first submitted.

          Originally posted by Dana
          Dana:
          I have gone through the code painstakingly numerous times attemptin gto
          You should really consider applying the same level of attention to what you post. It is not easy to follow what you are trying to say when you leave out most of the information and leave in all the typos and spelling mistakes. I don't mean to keep criticising your attempts, but this is very difficult to get any understanding from.

          I will look at the VBA code you've posted, and see if I can see where the SQL string that results should be correctly formed. That's all I can do for now as you don't make it clear even what you want. You've certainly not followed Z's instructions very closely, so we're not clear what you want; what you've tried; what went wrong when you tried; etc.

          As far as I can see, the VBA code is fine and will create the string for you. The string is certainly not valid SQL and I would expect to see errors if you were to submit this string for SQL execution.

          Everything is fine except the WHERE clause, which has an extraneous closing parenthesis ")" and dates being compared with integers.

          I will post some links which I hope you will find useful. They are very useful but you will need to read and understand to benefit from them.
          Before Posting (VBA or SQL) Code - It's much harder to deal with SQL problems at the VBA level than at the SQL level.
          Literal DateTimes and Their Delimiters (#) - When working with date literals (as you should be, whether you realise it or not) it is important that they are formatted correctly.

          Working with SQL in VBA (as you're doing here) is not as simple as many people imagine. More people than you know struggle with this. Don't feel bad that you are too, but work clever rather than hard. Split the two out so you only have to work at one level at a time.

          Comment

          Working...