Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195

    Ok guy's thank you

  2. #17
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,966
    I cannot have it in my signature here, but I do have it on another site.
    See the post by moke123 in this thread. Micron also supplied a function in that thread.

    https://www.access-programmers.co.uk...ed-dbs.306745/
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #18
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195
    Thanks WGM, i am still trying to work out stepping as all of you suggest it will help massively

    I've just read through the link from orange (Debugging VBA and Error Handling)

    Pressing Grtl+G opens immediate window
    placing cursor at the front of the line to start stepping
    press F8 or Step into from Debug Menu also Shift F8

    Nothing then appears in the immediate window

    I need to read more into this to help myself identify

    Can i Step any code ?

    So if i had a line strBody = rs.Fields etc etc

    just cursor the front of strBody ?

    CURSOR HERE ? strBody = strBody & rs.Fields("DelTo") & vbTab & rs.Fields("Town") & vbTab & rs.Fields("SONumber") & vbTab & rs.Fields("ItemNo") & vbTab & rs.Fields("DeliveryDate") & "|"
    Debug.Print strBody

  4. #19
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,966
    Alt + F11 will open the VBA window.
    You left click to the left of the code, in the left colum. That puts a red dot (a breakpoint) where the code will stop.
    Then I tend to press F8 and step line by line.
    You can set multiple breakpoints and use F5 which will run the code until the end, and error or the next breakpoint.

    You NEED to learn this, to get to errors like this, especially what I call 'silly' errors, where when you find find it, you want to smack yourself in the forehead.

    So if you are processing a form, set the breakpoint in the VBA window, then execute the form, button, combo, whatever and then work from there.
    You can also hover the mouse over variables and it will show the value.

    There is a link in my signature here for Debugging Access. Use it!
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #20
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,807
    Randomizer is also at this forum:

    https://www.accessforums.net/showthread.php?t=77482
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #21
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,966
    Moke123's Db is also here somewhere. Just easier to search, for me at least on the other site.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #22
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,807
    Quote Originally Posted by Welshgasman View Post
    Moke123's Db is also here somewhere. Just easier to search, for me at least on the other site.
    If you're intending to refer to one or the other frequently then bookmark one? No searching required.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #23
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,655
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Looping Is Incorrect
    By DMT Dave in forum Access
    Replies: 14
    Last Post: 07-11-2021, 07:45 PM
  2. Replies: 2
    Last Post: 09-19-2017, 11:31 AM
  3. Incorrect data
    By Traceyann1964 in forum Database Design
    Replies: 1
    Last Post: 01-20-2016, 09:57 AM
  4. RecordCount after filtering is incorrect
    By George in forum Access
    Replies: 2
    Last Post: 05-29-2012, 01:02 PM
  5. Incorrect Sums
    By Azyrus in forum Reports
    Replies: 6
    Last Post: 06-26-2011, 04:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums