To begin with I am tankful for your precious time to watch this and thankful for help in advance.
Content1 is lookup field. This value coming from another table. In current table (i.e. TblQuality ) its showing value but in Debug.Print Stg its giving primary key. How can i retrieve value and not primary key. I have trim this code to simplest however i am truncating fields as per certain conditions with help of for next loop but for ease of my understanding i have removed that part.
Private Sub Command23_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String
Dim Stg As Variant
Dim fld As Field
Set db = CurrentDb
strSQL = "SELECT * FROM TblQuality WHERE QualityID = " & Me!QualityID
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)
Stg = rst!Content1
Debug.Print Stg
rst.Close
Set rst = Nothing
Set db = Nothing
End Sub
I highly appreciate your valuable support. Thanks to everyone for support.
Content1 is lookup field. This value coming from another table. In current table (i.e. TblQuality ) its showing value but in Debug.Print Stg its giving primary key. How can i retrieve value and not primary key. I have trim this code to simplest however i am truncating fields as per certain conditions with help of for next loop but for ease of my understanding i have removed that part.
Private Sub Command23_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String
Dim Stg As Variant
Dim fld As Field
Set db = CurrentDb
strSQL = "SELECT * FROM TblQuality WHERE QualityID = " & Me!QualityID
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)
Stg = rst!Content1
Debug.Print Stg
rst.Close
Set rst = Nothing
Set db = Nothing
End Sub
I highly appreciate your valuable support. Thanks to everyone for support.