Ok guy's thank you
Ok guy's thank you
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
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
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
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.
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
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
If this helped, please click the star * at the bottom left and add to my reputation- Thanks