After update

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • katlego
    New Member
    • Mar 2010
    • 5

    #1

    After update

    Hi

    Can sum1 plz help i want to display student results on the studentSubform based on the selection i make in the combobox so far this is what ive got.
    Query called students whereby the names of all the students are retrieved from the query into the combobox, the link master fields and child fields are linked with the student name abd behind the after update action i have got the following code:
    Private Sub Combo6_AfterUpd ate()


    DoCmd.ShowAllRe cords
    Me!Studentsubfo rm1.SetFocus

    DoCmd.FindRecor d Me!Combo6

    Me.Combo6.Value = ""

    End Sub

    but everytime i click in the combobox to select the name of the student nothing happens but when i click enter the subform changes the results it displays but it doesnt go back to the previously selected students details i hope im making sense. Can sum1 help if they can and please tell me what im currently doing wrong.

    Thanks
  • Delerna
    Recognized Expert Top Contributor
    • Jan 2008
    • 1134

    #2
    have you put breakpoints on the code in the Afterupdate event and then tried running the form to see if the code is actually being run?

    Comment

    • katlego
      New Member
      • Mar 2010
      • 5

      #3
      Howzit Delerna im actually just starting to use access and im not that really familar with it. So i dont really understand what are breakpoints. So how do i put in the breakpoints?

      Comment

      • Delerna
        Recognized Expert Top Contributor
        • Jan 2008
        • 1134

        #4
        On the code page (where you have your after update function)
        Down the left side of that window you will see a border (probably grey)
        If you click on that margin and next to a line of code, a red circle will appear.

        That is a breakpoint.
        When you run your form and cause that code to be executed then the program will stop at any line that has a breakpoint and display the code window with the current line of code that is being executed highlighted yellow.

        You can hover your mouse over variables to see their contents and many other debugging tasks, including single stepping through you code so you can see how it is being executed.

        I suggest you use access help document and search for "debugging" or "breakpoint s"

        Comment

        • Delerna
          Recognized Expert Top Contributor
          • Jan 2008
          • 1134

          #5
          A picture is worth 1000 words

          so here is one of a breakpoint

          Where the red circle is, is where you need to click to set/unset the breakpoint

          And the debug menu has options that relate to breakpoints and debugging code


          Experiment..... it will be time well spent
          Attached Files

          Comment

          • Delerna
            Recognized Expert Top Contributor
            • Jan 2008
            • 1134

            #6
            If you set a breakpoint and run the form and then do something that you believe should cause the code to execute.

            If you do that and the code window doesn't pop up with the breakpoint line highlighted yellow.
            That means the line of code with the breakpoint is not getting executed at all ...... ever

            Comment

            Working...