Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

Thread Tools Rate Thread Display Modes
Old 02-23-2017, 09:45 AM   #1
Newly Registered User
Join Date: Oct 2010
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
debbiedoobie10 is on a distinguished road
Access VBA code works sometimes after 2016 conversion

The code below was created in access 2013. I am in the process of upgrading to access 2016 and this code works sometimes. My process to find that this is the code that is not working is to step into the code and stop when the data is incorrect. Remove the data that is incorrect and step into the code again and this time it will work. I have not found a pattern to the why it works sometime. Can anyone help?

Function CodeTPCash()

Dim intDayCtr As Integer
Dim rstbltp64g As DAO.Recordset
Dim rstbltp66g As DAO.Recordset

Set MyDB = CurrentDb
Set rstbltp64g = MyDB.OpenRecordset("tblTP64G", dbOpenForwardOnly)
Set rstbltp66g = MyDB.OpenRecordset("tblTP66G", dbOpenForwardOnly)

With rstbltp66g
Do While Not .EOF
For intDayCtr = 0 To DateDiff("d", ![tBegbalDate], ![tDate]) - 1
DoCmd.OpenQuery "qryTP82G", , acReadOnly

Query qryTP81G
Field: mDate TotalCash
Table: TblTP64G TblTP64G
Total: Min group By
Criteria: is null

Query qryTP82G
Field: trxdate runningtotal Minofmdate
Table: tblTP31G tbltp31G qryTP81G
Total: Group By Sum Group by
Criteria: <=[minofmdate]

DoCmd.OpenQuery "qryTP84G", , acReadOnly
Query qryTP84G
Field: TotalCash
Table: TblTP64G
Update to: [tblTP83G]![sumofrunningtotal]

End With
DoCmd.OpenQuery "qryTP86G", acViewNormal, acEdit
Set rstbltp64g = Nothing
Set rstbltp66g = Nothing
End Function

debbiedoobie10 is offline   Reply With Quote
Old 02-23-2017, 10:11 AM   #2
Super Moderator
MarkK's Avatar
Join Date: Mar 2004
Location: Vancouver BC
Posts: 7,761
Thanks: 10
Thanked 1,290 Times in 1,227 Posts
MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all
This appears to be exactly the same post as this...
formerly known as lagbolt | Windows 10 | Access 2010 | Visual Studio 2013 | "Institutions have a vested interest in perpetuating the problems to which they are the solution." - Clay Shirky
MarkK is offline   Reply With Quote

vba access 2016

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Deploying Access 2016 Front End, Access 2016 RossWaddell General 2 07-24-2016 05:43 AM
[SOLVED] conversion from office 97 to 2016 issue "rightjoin" Devilius028 Queries 2 02-17-2016 05:14 AM
Code No Longer Works with Access 2007 Jezmondrose Modules & VBA 3 01-28-2009 05:44 AM
Access ADP VBA code works first time. Does not work if run again ak_ls Modules & VBA 5 12-26-2008 11:13 AM
Excel VBA conversion to Access code Curry Modules & VBA 0 02-28-2004 09:23 PM

All times are GMT -8. The time now is 07:03 PM.

Microsoft Access Help
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post

Sponsored Links

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World