P
placek
hello
i have a subform based on a query, and i run a procedure
that amends the query. The query is named qryBook and the
subform is named fsubBooks.
My hope is that the subform should display the contents of
the query, though this does not happen. Although the query
does update, the subform does not. In order to display the
contents of the query in the subform i have to return to
design view and then to form view. I would like the
subform to update without having to do this. Can anyone
help? My procedure is............
Private Sub Command2_Click()
Dim query As QueryDef
Dim db As Database
Set db = DBEngine(0)(0)
Set query = db.QueryDefs("qryBook")
query.SQL = "select
tblacquisitionrelation.lngacquisitionnumbercnt,
tblbookrelation.strisbn, tblbookrelation.strtitle,
tblbookrelation.strAuthor, tblbookrelation.strcategory,
tblloanrelation.dtmdateborrowed FROM tblloanrelation right
join (tblacquisitionrelation INNER JOIN tblbookrelation ON
tblacquisitionrelation.strisbn=tblbookrelation.strisbn) on
tblloanrelation.lngacquisitionnumbercnt=tblacquisitionrelat
ion.lngacquisitionnumbercnt where isnull
(tblloanrelation.dtmdatereserved) AND not isnull
(tblloanrelation.dtmdateborrowed) OR not isnull
(tblloanrelation.dtmdatereserved) AND not isnull
(tblloanrelation.dtmdateborrowed)"
Me.fsubBooks.Form.Requery
query.Close
db.Close
End Sub
Many Thanks
Martin
i have a subform based on a query, and i run a procedure
that amends the query. The query is named qryBook and the
subform is named fsubBooks.
My hope is that the subform should display the contents of
the query, though this does not happen. Although the query
does update, the subform does not. In order to display the
contents of the query in the subform i have to return to
design view and then to form view. I would like the
subform to update without having to do this. Can anyone
help? My procedure is............
Private Sub Command2_Click()
Dim query As QueryDef
Dim db As Database
Set db = DBEngine(0)(0)
Set query = db.QueryDefs("qryBook")
query.SQL = "select
tblacquisitionrelation.lngacquisitionnumbercnt,
tblbookrelation.strisbn, tblbookrelation.strtitle,
tblbookrelation.strAuthor, tblbookrelation.strcategory,
tblloanrelation.dtmdateborrowed FROM tblloanrelation right
join (tblacquisitionrelation INNER JOIN tblbookrelation ON
tblacquisitionrelation.strisbn=tblbookrelation.strisbn) on
tblloanrelation.lngacquisitionnumbercnt=tblacquisitionrelat
ion.lngacquisitionnumbercnt where isnull
(tblloanrelation.dtmdatereserved) AND not isnull
(tblloanrelation.dtmdateborrowed) OR not isnull
(tblloanrelation.dtmdatereserved) AND not isnull
(tblloanrelation.dtmdateborrowed)"
Me.fsubBooks.Form.Requery
query.Close
db.Close
End Sub
Many Thanks
Martin