Assistance in accessing a single field ado

R

Ron Weiner

Not shure what your question is, but here is a guess.

Public Sub YourSub()
Dim rs As ADODB.Recordset, strSomeValue as String

Set rs = New ADODB.Recordset
rs.Open "SomeTableName or Sql statement", _
CurrentProject.Connection, adOpenDynamic, adLockOptimistic
With rs
If not .EOF Then
strSomeValue = Nz(!SomeFieldName,"")
Debug.Print "SomeFieldName in SomeTable = " & strSomeValue
End If
.Close
End With
Set rs = Nothing
End Sub

Please note there is no error checking here. In a real app you will want to
add some.

Ron W
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top