pungentSapling
NeedHotSauce?
- Local time
- Today, 12:11
- Joined
- Apr 4, 2002
- Messages
- 116
I have a bit of code that creates a one field recordset... however, the record set does not always contain the same field. How can I reference the first field in the recordset without always knowing what the field is called? I sthere a way to reference it by its index?? for instance does the first field in a recordset always have an index of "0"?
here is a snippet of the code (it is a function that is supposed to return the value in the first field(of the first record) of the recordset:
Set dbs4 = CurrentDb
sql = "SELECT " & sEstRef & " FROM tblEstAssembly WHERE woID =" & iWoID
Set rst4 = dbs4.OpenRecordset(sql)
If rst4.EOF = False Then
rst4.MoveFirst
fGetEstimate = rst4!****HERE IS WHERE I AM STUCK***
End If
Set rst4 = Nothing
Set dbs4 = Nothing
End Function
clear as mud???
thanks
here is a snippet of the code (it is a function that is supposed to return the value in the first field(of the first record) of the recordset:
Set dbs4 = CurrentDb
sql = "SELECT " & sEstRef & " FROM tblEstAssembly WHERE woID =" & iWoID
Set rst4 = dbs4.OpenRecordset(sql)
If rst4.EOF = False Then
rst4.MoveFirst
fGetEstimate = rst4!****HERE IS WHERE I AM STUCK***
End If
Set rst4 = Nothing
Set dbs4 = Nothing
End Function
clear as mud???
thanks