Hello...I'm trying to run an SQL statement to make a textbox equal a search of a query based on criteria in labels in my form..Now this SQL statement works from Excel to Access but not in Access in my form. I'm thinking that it has to do with in Excel the field I was searching to match Datestamp was actually date formatted and of course the label in the Access form is not a formatted date
So Rep is a text format and Datestamp is a date format in the table from where the query grabs it from...I need to make that Text371 equal to one of the query results in MakePercentages based on those conditions. Any ideas on what is going wrong with the formatting of this statement here as I know the statement itself does work just coming from Excel. Thanks! Let me know if you need more info.
Code:
Me.Text371.ControlSource = "SELECT SumOfExpr3 FROM MakePercentages WHERE Datestamp = " & Day27.Caption & " And Rep = " & Label7.Caption & ""
So Rep is a text format and Datestamp is a date format in the table from where the query grabs it from...I need to make that Text371 equal to one of the query results in MakePercentages based on those conditions. Any ideas on what is going wrong with the formatting of this statement here as I know the statement itself does work just coming from Excel. Thanks! Let me know if you need more info.