I am trying to populate a field on a form with a SQL query that is fed variables from some vba code.
I would like the information to populate on an event action but can't quite figure out how to do it. The vba code basically establishes an array of months and years for use in my select statements. the vba procedure name is DetectMonth. I have the following code.
What I am lacking is:Code:Call DetectMonth strSQL = "SELECT Project FROM [Client Relationships] WHERE Client = [Forms].[Strategy Binder].Client AND M = " _ & "'" & CurrentMonth0 & "'" & " AND Y = " & CurrentYear0 & ";"
1. The DAO connection information to the table which is named [Client Relationships]
2. A link between the form field and the query result
The query result will be 1 record consisting of one word
Any help would be appreciated. My main struggle is the DAO connection information. I haven't used access much for programming but would like to take a lot of the work I've done in excel and convert it to access.