Hi everyone,
I found this code online. What I would like it to do is pull a value from a field(ConcAdd) in a table (tbl_ForcD2) which I will manipulate and use to populate a field in a query using this module. the problem I am running in to is that this code pulls the first value from the field ConcAdd repeatedly. What I would like is for this module to grab the next value in that field instead of the first value repeatedly.
Example:
ConcAdd Target Field(where module is called in query)
111 Street Road 111 Street Road(Actual)111 Street Road(Desired)
222 Street Road 111 Street Road(Actual)222 Street Road(Desired)
333 Street Road 111 Street Road(Actual)333 Street Road(Desired)
...
Here is the Code
Dim db As Database
Dim lrs As DAO.Recordset
Dim lsql As String
Dim lgst As String
Set db = CurrentDb()
lsql = "select ConcAdd from tbl_ForcD2"
Set lrs = db.OpenRecordset(lsql)
If lrs.EOF = False Then
lgst = lrs("ConcAdd")
Else
lgst = "Not found"
End If
lrs.Close
Set lrs = Nothing
Thanks