I'm wondering if anyone would know how to get data to show up in a label caption based on SQL statements that are stored in String values. For example, I have a label name testLabel and I'm using the following SQL statement to pull information from a table and input it into the label:
Private Const strSQL1 = "SELECT Field1 FROM Table1 WHERE Column = 'Testing Testing'"
Is there any way to get the Value of that String to appear in a Label somehow?
This is what I tried:
Me!testLabel.Caption = strSQL1
And I also tried:
Me!testLabel.Value = strSQL1
I've tried to assign that statement to the caption and value properties, but that only puts the literal "SELECT Field1 FROM Table1 WHERE Column = 'Testing Testing'" result of the String--not the value itself. I never get the value to show up in the label, only the SELECT statement. This is my second attempt at this because the first time I tried using a List Box and got the data there, but there was another problem with that I ran into. Let me know if you have any ideas at all. I'm using Access 97 too. Thanks much!