Thanks for the response. Right after I posted my question I found an answer to it, which was putting my string variable in parenthesis:
Reports!rptFlgT est!(strFieldNa me) = -1
In fact, I went 1 step further and eliminated the variable, putting a path to a field returned by SQL statement in parenthesis:
Dim rsttblFlags As Recordset
strSQL = 'some SELECT St-t here that retrieves rows from a MS Access...
User Profile
Collapse
-
using a variable as part of the reference path
I'm trying to set up a value for a control on the report and part of the path should be a variable, since I have multiple objects like that. So when I try to put a variable I'm getting the "Compile Error: Syntax Error" message and don't know how to handle it.
Reports!rptFlgT est!"& strFieldName &" = -1
I've tried to put single quotes around double ones as well as not to use any; or not to use... -
problems with changing the defaults
I'm trying to change the default property for a check box field on a form as well as a a particular property of that form. After I run the code both the form and the control start behaving the way I expect they should after the change, but their properties, in fact, never change.
Here's the code to swap between the Dynaset and Snapshot RecordsetType properties in the form. After its execution, when I reopen the form, however, it is... -
It works but I just discovered that either Date or CustID is not taken into consideration in the evaluation, i.e. only one condition can actually be used in FindFirst as opposed to "Where" clause in SQL statement that can use multiple AND's & OR's. This is because my next statement, If .NoMatch evaluates to True even if there are records in the table that has a combination of CustID and Date which have been evaluated by .FindFirst statement....Leave a comment:
-
-
Using AND operator with FindFirst method
I'm using FindFirst method in Access VBA to find a particular record in a recordset. I have 2 search criteria each of which works just fine if used separately as an argument in FindFirst, but NOT in combination with one another. I tried various combinations of quotes, double quotes, brackets and paranthesis but in case of using 2 conditions I'm still receiving the error message saying "run-time error 13 - type mismatch". If I use just one...
No activity results to display
Show More
Leave a comment: