Microsoft Access 2010, insert multiple records based on specific days in date range

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Demeter
    New Member
    • Jul 2019
    • 3

    Microsoft Access 2010, insert multiple records based on specific days in date range

    I have an Access 2010 database that our staff use to keep track of appointments and activities. Some events occur weekly, and I would like the staff to be able to create those entries by selecting the day of the week and the start and end dates of the event. I am relatively new to VBA coding. I have found some examples that appear to replicate the entry daily across a series of dates, but I do not know how to tell Access to put in the entry for, say, every Wednesday, between those dates.

    The staff are entering the information in a form bound to the main table. xtxBeginningDat e and txtEndingDate are the fields for the dates. cmbWeekday allows users to select the day of the week. The table is tblEventsRecord s and the form is fmEventsRecords . I have a CalendarDates table.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    #2
    This will require code as this is a job you're requesting.

    If you want help with it then please come back when you've started and are struggling with a particular aspect. We're not here simply to do your jobs for you.

    Comment

    • Demeter
      New Member
      • Jul 2019
      • 3

      #3
      I have started. This database has been actively in use by the staff for over a year without issues. I have done extensive searches on how to do this, as I said in my original post, and have come across code that works on situations like mine, but it will insert a record for every day in that date range, not just for one particular weekday in that date range. A record for every day is not appropriate in this situation.

      In my attempt to do this myself I have created a CalendarDates table, a query that will return all the weekdays in the date range, and and query that will duplicate the current record for every day selected by the weekday query, which gives me the exact records that I want. However, they can't be appended, updated, or saved to the original table because they don't generate the required automunber.

      I am not asking anyone to do my job for me, I am asking for help with one specific part of it. If you don't want to help, that's fine, please just move on. I am not here to be scolded.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32633

        #4
        I've had to remove what you posted and grandly selected as the Best Answer.

        Before we set a Best Answer we first need a clear and qualifying question. I suggest if that's too much to ask, then you move on elsewhere. Otherwise you'll be expected to follow the rules and guidelines for the site. If you fail to manage that then you will certainly have this explained to you. We don't make special allowances for the precious. As I say, if that's not something you can handle then I'm sure all parties would be happier if you just move along elsewhere.

        Comment

        • Demeter
          New Member
          • Jul 2019
          • 3

          #5
          I'm nobody's "precious". Never be been, never will be. I'm sorry I gave you or anyone else the impression I might be.

          My expectations for this post were low. At best, somebody might be able to point me in the right direction and I'd get something that worked. At worst, I'd be ignored,which leaves me no worse off than I was.

          What I did not expect was for NeoPa to visit my post - why would he? He might be the very best teacher on here, and I'm absolutely nobody.

          Yet he did, and he essentially sent me home for not knowing how to do what I was asking help on learning how to do. I've never seen that happen, in all the posts I've read here. I'm not saying it hasn't happened before, just that this is the first time I've ever seen it happen. So I'm a bit shocked, and what I know is it's on me to find the answer to this, and I'm not going to find the answer in coding.

          I'm sorry my solution can't be posted, but since it can't be then please close this thread, or take it down, or whatever you need to do. I'm so far past this now that anyone who might dare to help me later isn't really going to be helping, and I don't want to waste anyone's time here.

          I'll be back, because I have to, because I have so much to learn, but I won't be posting anymore. This post went sideways almost the minute I posted it. I'll stick to Google from here on out.

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32633

            #6
            I was not saying you were my precious. Far from it. I was saying your behaviour was precious. There's a big difference. All expectation / no responsibility.

            Like a few others you come along expending very little effort and expect others to do all the heavy lifting, and woe betide anyone having the temerity to try to put you straight. I don't mind a bit of heavy lifting if the one I'm working with is along for the ride, but you made it clear very early on that expecting the basics from you seems unreasonable to you. That's fine. Just don't expect anyone to put themselves out for you with such an attitude.

            Even now it's all about you and unfair, etc, blah di blah. Not one word have I seen from you in all this thread that indicates you've given a moment's thought to the possibility that you may have to do something differently to conform to the site rules. It really is impossible to work with those that already know everything. It's just surprising that so many of them still seem to need to ask for help so often.

            Comment

            • twinnyfo
              Recognized Expert Moderator Specialist
              • Nov 2011
              • 3653

              #7
              And..... (I am not usually wont to pile onto other's threads, but...)

              There is also another good reason NeoPa deleted the "Best Answer"--because it had nothing to do with solving your problem. If that solution was able to assign a list of appointment dates on Wednesdays, then great, but I can't see how it could have.

              Just a free hint here, but Access has a nifty function called Weekday(), which returns a numerical value for the day of the week, based upon the date that is sent to the function. I am sure that this might be a place to start.

              If you would like to make future posts, my guidance is this: 1) Explain your problem (that is, what you are trying to do); 2) show us what you have tried so far; 3) explain how what you have tried so far does not work (don't just say, "It doesn't work--please hepp!"--which is a common and frustrating occurence on this site), that is, explain to us that it is throwing an error (and tell us the exact error and what line is causing the error) or tell us that your results are different than expected; 4) Post any relevant code and describe any relevant table structures if necessary.

              If you do that, we are more than happy to hepp! NeoPa and I have been doing this for a day or two and we both truly want to hepp users understand how to make Access work for them. But, please understand that I have been doing this for 25 years and NeoPa probably wired the first integrated circuit..... We expect that there will be folks out there who are new to Access and don't understand everything. But, we have gained the experience we have by working hard at learning our craft, asking questions of others and learning from our challenges and mistakes. There is no shortcut to expertise in any discipline. So, when we ask for some effort on a post that does not demonstrate any effort (even though you may have tried a thousand things--we saw no evidence of that), you may expect us to presume that you have not put any effort into your project. This presumption is not always correct, but we must evaluate based upon what we see, not upon what you know.

              I do hope you are able to post new questions, and that this site serves as a valuable resource for you. It has hepped many--including myself.

              Warmest regards,
              Twinnyfo

              Comment

              Working...