I have the following code, which is not working for me,
What im trying to do is, retreive values from two tables, which are identical.
The reason why im doing this is because each table represents a months worth of data which is given to me at the begining of each month, Normalization is not really an option at this point, but might be in the future.
Function YTDINDBOARDED()
Dim db As DAO.Database
Dim rst1 As DAO.Recordset
Dim rst2 As DAO.Recordset
Set db = CurrentDb()
Set rst1 = db.OpenRecordset("SELECT Ind_Bact_Act FROM Sales_ReportResult")
Set rst2 = db.OpenRecordset("SELECT Ind_Bact_Act FROM Sales_ReportResult1")
boarded = rst1(0) + rst2(0)
End Function
The function does not give an error, It simply does not return anything,
When i create a query and call the function using an expression
test: YTDINDBOARDED() the query pops up which is empty,
Anyone able to point out some assistance, id be greatful
Thanks,
What im trying to do is, retreive values from two tables, which are identical.
The reason why im doing this is because each table represents a months worth of data which is given to me at the begining of each month, Normalization is not really an option at this point, but might be in the future.
Function YTDINDBOARDED()
Dim db As DAO.Database
Dim rst1 As DAO.Recordset
Dim rst2 As DAO.Recordset
Set db = CurrentDb()
Set rst1 = db.OpenRecordset("SELECT Ind_Bact_Act FROM Sales_ReportResult")
Set rst2 = db.OpenRecordset("SELECT Ind_Bact_Act FROM Sales_ReportResult1")
boarded = rst1(0) + rst2(0)
End Function
The function does not give an error, It simply does not return anything,
When i create a query and call the function using an expression
test: YTDINDBOARDED() the query pops up which is empty,
Anyone able to point out some assistance, id be greatful
Thanks,