Private Sub cborentals_AfterUpdate()
Dim who As String
Me.cbostudent.Value = cborentals.Column(1)
Me.Fname.Value = cborentals.Column(5)
Me.Lname.Value = cborentals.Column(6)
Me.sgrade.Value = cborentals.Column(7)
Me.CLASS.Value = cborentals.Column(8)
Me.cbobookid.Value = cborentals.Column(2)
who = cborentals.Column(2)
strSql = "SELECT Bookname FROM Books WHERE Books.Bookid = '" & who & "' "
'strSql2 = "SELECT Books.Subject as SubjectName FROM Books WHERE Books.Bookid = '" & who & "' "
Set rst = CurrentDb.OpenRecordset(strSql)
'Set rst2 = CurrentDb.OpenRecordset(strSql2)
If rst.EOF Then
Else
Me.book.Value = rst!Bookname
End If
'If rst2.EOF Then
'Else
' Me.subject1.Value = rst!SubjectName
'End If
End Sub
Im trying to get subject name and book name from my book table, based on a book ID. how do i do all this with one query & result set
Dim who As String
Me.cbostudent.Value = cborentals.Column(1)
Me.Fname.Value = cborentals.Column(5)
Me.Lname.Value = cborentals.Column(6)
Me.sgrade.Value = cborentals.Column(7)
Me.CLASS.Value = cborentals.Column(8)
Me.cbobookid.Value = cborentals.Column(2)
who = cborentals.Column(2)
strSql = "SELECT Bookname FROM Books WHERE Books.Bookid = '" & who & "' "
'strSql2 = "SELECT Books.Subject as SubjectName FROM Books WHERE Books.Bookid = '" & who & "' "
Set rst = CurrentDb.OpenRecordset(strSql)
'Set rst2 = CurrentDb.OpenRecordset(strSql2)
If rst.EOF Then
Else
Me.book.Value = rst!Bookname
End If
'If rst2.EOF Then
'Else
' Me.subject1.Value = rst!SubjectName
'End If
End Sub
Im trying to get subject name and book name from my book table, based on a book ID. how do i do all this with one query & result set