John,
Thank you that worked. I also took a different approach to fix it because i felt like i was getting nowhere with the other way so i removed the dmax part from the sql where statement and made it its own above the sql statement like the Var_Date dmax. then I made the where statement equal to each of those variables. It seemed so easy that way. I dont know why I didnt think of that sooner.
Thank you all for your help.
Here is my code and how I fixed it for anyone to look at later.
Code:
Private Sub btnInProc_Click()
'On Error GoTo EH
Dim sSql As String
Dim Var_Date As Date
Dim Var_Load As String
Var_Date = DMax("TestedDate", "tbl_343sTested")
Var_Load = DMax("LoadTested", "tbl_343sTested", "(tbl_343sTested.TestedDate)=#" & Var_Date & "#")
txtVar_Date = Var_Date
Debug.Print "<" & Var_Date & ">"
Debug.Print "<" & Var_Load & ">"
DoCmd.Hourglass True
sSql = "SELECT tbl_343sTested.FixturePosition, tbl_343sTested.SerialNumber, tbl_343sTested.TestedDate, tbl_343sTested.Technician, " _
& " tbl_343sTested.TankTestedIn, tbl_343sTested.LoadTested, tbl_343sTested.PrePressureReading, tbl_343sTested.PrePressureUnits, tbl_343sTested.PreReading, " _
& " tbl_343sTested.HighPressureReading, tbl_343sTested.HighPressureUnits, tbl_343sTested.HighReading, tbl_343sTested.PostPressureReading, " _
& " tbl_343sTested.PostPressureUnits, tbl_343sTested.PostReading, tbl_343sTested.Recheck, tbl_343sTested.PassFail, tbl_343sTested.Tr343Id, " _
& " tbl_343sTested.MeggerID, tbl_343sTested.PressureIndID, tbl_343sTested.Comment " _
& " FROM tbl_343sTested " _
& " WHERE (((tbl_343sTested.TestedDate)=#" & Var_Date & "#) AND ((tbl_343sTested.LoadTested)=" & Var_Load & "))"
Debug.Print sSql
Set dbTest = CurrentDb
Set rstTestData = dbTest.OpenRecordset(sSql)