Private Sub erikatesting_Click()
Dim dbs As DAO.Database
Dim myQueryDef As DAO.QueryDef
Dim strSql As String
Dim rst As DAO.Recordset
Dim DEPT As String
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("AcctPeriod_tbl")
DEPT = rst!DeptID
strSql = "SELECT A.ACCOUNT AS ACCOUNT, B.DESCR AS DESCR, A.DEPTID AS DEPT, A.PRODUCT PRODUCT, FISCAL_YEAR AS YEAR, " & _
"FROM PSFSP8.PS_LEDGER A, PSFSP8.PS_GL_ACCOUNT_TBL B " & _
"WHERE ( A.BUSINESS_UNIT = ('WDBIL') " & _
"AND A.DEPTID = DEPT & _
" GROUP BY A.ACCOUNT, B.DESCR, A.PRODUCT, A.DEPTID, A.FISCAL_YEAR " & _
" ORDER BY 3, 1 WITH UR;"
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.