Access Attendance table help; Need to update table daily w/o copying table twice

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3653

    #16
    So--what you have done is copied and pasted from the raw text. You should copy and paste from your immediate window. This will give you the true SQL string you want to work with (it should show a date instead of " & Me.txtDate & ".

    Plus - update your code to my updated code in post #10.

    Comment

    • brikusi
      New Member
      • Mar 2019
      • 44

      #17
      on on my form, on the "On.Open" field I selected the event procedure as you directed. I pressed ctrl G and got a new window, but there was no where to insert the code.

      Was I to create a new module? The immediate Window option was greyed out so I went back to my form, and next to the event procedure were 3 dots (Ellipses) and a VBA window appeared where i put the code there.

      Is that not correct?

      Thanks for showing me how to add pictures, updated previous reply with images.

      Comment

      • twinnyfo
        Recognized Expert Moderator Specialist
        • Nov 2011
        • 3653

        #18
        Once you "Open" the form (NOT in design view) the form will create some text in that new window, which is called the Immediate Window.

        Comment

        • twinnyfo
          Recognized Expert Moderator Specialist
          • Nov 2011
          • 3653

          #19
          OK - since Access has a mind of its own--

          I previously (like, yesterday), got this very same query to work without a hitch, but today, that very same query that worked perfectly, does not want to cooperate.

          Soooooooooo.... . Please recopy and paste the code lines 13-23 above into your VBA. For whatever reason, it wants to have this additional "OR" statement.

          Comment

          • brikusi
            New Member
            • Mar 2019
            • 44

            #20
            I hope I'm not being difficult.
            I've updated the code to reflect your changes

            I opened the form (not in design view) and see nothing
            I pressed CTRL G and see nothing. Images attached.

            No errors; nothing.

            Should anything be activated before using the code?
            I wish i could send you a copy of the database. There's no data inside.
            [imgnothumb]https://bytes.com/attachment.php? attachmentid=99 17&stc=1&d=1552 559852[/imgnothumb]
            [imgnothumb]https://bytes.com/attachment.php? attachmentid=99 18&stc=1&d=1552 559852[/imgnothumb]
            Attached Files
            Last edited by twinnyfo; Mar 14 '19, 10:38 AM. Reason: inline images

            Comment

            • twinnyfo
              Recognized Expert Moderator Specialist
              • Nov 2011
              • 3653

              #21
              The form should be creating a string and displaying it in the immediate window. Make sure your immediate window is displayed before you open the form and try it again. I’ll have to take a look tomorrow.

              BTW, your form might be a little bit large—remember it just has to be able to display two lists. HOWEVER (and this is good) it looks exactly like it should look at this point.

              And...... you are not being difficult at all. You are willing to go through this effort to learn, rather than demanding that I just do it for you. It took me about an hour to get things working right. But you are learning and it is worth MY effort to teach someone who wants to learn.

              Comment

              • brikusi
                New Member
                • Mar 2019
                • 44

                #22
                i think Im still a bit confused on what I should be doing or seeing at this point.

                i tried opening the immediate window 1st then the form. I still dont see a string of text.

                can I debug this somehow to see why this isn't working?

                Comment

                • twinnyfo
                  Recognized Expert Moderator Specialist
                  • Nov 2011
                  • 3653

                  #23
                  I think you are much closer than you think. Just confused because of newness.

                  Debugging:

                  Take a look at this:
                  [imgnothumb]https://bytes.com/attachment.php? attachmentid=99 19&stc=1&d=1552 559403[/imgnothumb]
                  See where the dark red dot is? Click your mouse in your VBA Editor in the left border right there. Now Open your Form. Your DB will then highlight that line of code, because it is a break point that the DB wants you to debug.

                  As you hit the F8 key, you will move line by line as the code executes.

                  If your DB never takes you there, then make sure that your form's property sheet looks like this:
                  [imgnothumb]https://bytes.com/attachment.php? attachmentid=99 20&stc=1&d=1552 559744[/imgnothumb]
                  If not, be sure to select "[Event Procedure]" in the on open event. Sometimes Access will clear this out, even though there is a procedure declared for that event.

                  We will get this working. One step at a time.
                  Attached Files
                  Last edited by twinnyfo; Mar 14 '19, 10:40 AM.

                  Comment

                  • brikusi
                    New Member
                    • Mar 2019
                    • 44

                    #24
                    Ok so i ran the debug, every section highlighted as I f8 through the code. no errors.

                    I did a screen record but I can't upload the video here. so I just made a ppt walking through the steps.

                    I also confirmed that the event procedure we in the On Open field in the property sheet
                    [imgnothumb]https://bytes.com/attachment.php? attachmentid=99 21&stc=1&d=1552 583618[/imgnothumb]
                    [imgnothumb]https://bytes.com/attachment.php? attachmentid=99 22&stc=1&d=1552 583618[/imgnothumb]
                    [imgnothumb]https://bytes.com/attachment.php? attachmentid=99 23&stc=1&d=1552 583618[/imgnothumb]
                    [imgnothumb]https://bytes.com/attachment.php? attachmentid=99 24&stc=1&d=1552 583618[/imgnothumb]
                    Attached Files
                    Last edited by twinnyfo; Mar 14 '19, 05:14 PM.

                    Comment

                    • twinnyfo
                      Recognized Expert Moderator Specialist
                      • Nov 2011
                      • 3653

                      #25
                      And still nothing was sent to the Immediate Window?

                      Comment

                      • brikusi
                        New Member
                        • Mar 2019
                        • 44

                        #26
                        unless I am missing something, I didn't see it. Can you screenshot what it should look like?

                        Comment

                        • twinnyfo
                          Recognized Expert Moderator Specialist
                          • Nov 2011
                          • 3653

                          #27
                          Take a look here. Notice the bottom pane.
                          [imgnothumb]https://bytes.com/attachment.php? attachmentid=99 25&stc=1&d=1552 583558[/imgnothumb]
                          Attached Files

                          Comment

                          • twinnyfo
                            Recognized Expert Moderator Specialist
                            • Nov 2011
                            • 3653

                            #28
                            I still haven't seen any pictures of your immediate window, either. It will be a pane in your VBA Editor that simply says "Immediate" in the header bar.

                            Comment

                            • twinnyfo
                              Recognized Expert Moderator Specialist
                              • Nov 2011
                              • 3653

                              #29
                              You can also take a look at this tutorial on VBA Debugging in your free time.

                              Comment

                              • brikusi
                                New Member
                                • Mar 2019
                                • 44

                                #30
                                OMG I AM SOOOO SORRY I HAVE WASTED YOUR TIME....

                                All this time I have seen immediate window at the bottom thinking it was indicating that the screen i was looking at was the immediate window. After viewing your screen I now see it was collapsed and I had to drag it up.

                                Once I did that I see the sql code there...

                                sorry sorry sorry...


                                Update: I copied the sql from there and put it in a new query and it generated results with the personID, first name, and last name.

                                Comment

                                Working...