SQL and a bit confused

A real begineer

Registered User.
Local time
Today, 22:23
Joined
Nov 4, 2000
Messages
74
Having not done a lot with SQL I thought it easiest to create a query and copy the code into code. The question is that when I run the query, the code goes to the appropriate record, but the code below only brings up the first record. Is there some other step I am missing?

Private Sub Form_Load()
Dim strSQL As String


strSQL = "SELECT tblCPoolDetails.*, tblCPoolDetails.HomePhone" _
& "FROM tblCPoolDetails" _
& "WHERE (((tblCPoolDetails.HomePhone)=[Forms]![frmClientDetail]![txtHP]));"


End Sub

I have tried closing frmClientDetail after this code has run, or before neither variation seemed to remedy the problem.
 
I did not realise that. That's why it won't work then. I am trying to set the forms recordset based on the SQL statement.
 
Thanks very much Pat. Problem Solvered.
 

Users who are viewing this thread

Back
Top Bottom