Hi,
I have a form that is connected to a vba code that populates the data using SQL tables.
VBA Code:
Code:
Private Sub Form_Load()
Dim r As New ADODB.Recordset
Dim DC As New DataConnection
Dim strSQL As String
Debug.Print "Startvol" & Now
strSQL = "SELECT A.ID, P.FULL_NAME, Count(A.ID) AS CountOf_ID," & _
"FROM table1 AS A INNER JOIN table2 AS P ON A.ID = P.ID "
r.Open strSQL, DC.ConnectionName, adOpenKeyset, adLockOptimistic
Set Me.Recordset = r
Debug.Print "endvol" & Now
End Sub
The query works fine in the SQL and populates the data, but always shows #Name error on the form.
Form details:
3 text boxes
Each one has the Name and control source as ID, FULL_NAME, CountOf_ID.
Can anyone help me on this?
Thanks!