B
Bob Quintal
First thing I noticed is the lack of spaces between the wordsGood Evening
I am basically trying to fill 3 fields postcode, ward and UPRN on
a form on the afterupdate of a combo box which a users selects to
create an address. I was using dlookup but this was so slow
taking 30 secs to find and return the values looking up a table
with 120k entries.
I found this method by creating a recordset but I have a problem
with the following code. I keep getting a syntax in from clause
error.
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT * FROM
QryWardLook" & "WHERE
LUAddress = '" & Me!LUAddress & "'")
If Not rs.BOF And Not rs.EOF Then
Me.WardName = rs![WardName]
Me.[Post Code] = rs![PostCode]
Me.UPRN = rs![UPRN]
End If
rs.CLOSE
Set rs = Nothing
Any thoughts anyone. Thanks in advance for any help.
QryWardLook" & "WHERE
Try QryWardLook " & " WHERE
I doesn't hurt to have two, but none won't work for sure.
Hopefully, your LUaddress field is indexed. The recordset will be
almost as slow as dlookup unless it is.