P
placek
Hi
I'm having some problems with my subform but i don't know
how to solve it. Please take a look.
TblBorrowerRelation has two fields: lngBorrowerNumberCnt
and strBorrowerName. QryBorrowerRelation is based on
tblBorrowerRelation.
Form5 contains a text box, command button and subform
[fsubqryBorrowerRelation]. The subform is based on
qryBorrowerRelation. The user inputs a
Borrower Number in the text box and clicks the command
button. The event handler for the command button updates
qryBorrowerRelation. The code is as follows.
Private Sub Command0_Click()
Dim dbDatabase As Database
Dim qdfQueryDef As QueryDef
Dim varText_Box As Variant
varText_Box = Text5.Value
Set dbDatabase = DBEngine(0)(0)
Set qdfQueryDef = dbDatabase.QueryDefs
("qryBorrowerRelation")
qdfQueryDef.SQL = "select * from tblBorrowerRelation where
tblBorrowerRelation.lngBorrowerNumberCnt=" & varText_Box
me.fsubqryBorrowerRelation.requery
End Sub
The problem is that the sub form does not update after the
command button is clicked. The only way i can get the sub
form to update is by going into design view and then
returning to form view. How can i get the sub form to
update automatically? Any help is much appreciated.
Martin
I'm having some problems with my subform but i don't know
how to solve it. Please take a look.
TblBorrowerRelation has two fields: lngBorrowerNumberCnt
and strBorrowerName. QryBorrowerRelation is based on
tblBorrowerRelation.
Form5 contains a text box, command button and subform
[fsubqryBorrowerRelation]. The subform is based on
qryBorrowerRelation. The user inputs a
Borrower Number in the text box and clicks the command
button. The event handler for the command button updates
qryBorrowerRelation. The code is as follows.
Private Sub Command0_Click()
Dim dbDatabase As Database
Dim qdfQueryDef As QueryDef
Dim varText_Box As Variant
varText_Box = Text5.Value
Set dbDatabase = DBEngine(0)(0)
Set qdfQueryDef = dbDatabase.QueryDefs
("qryBorrowerRelation")
qdfQueryDef.SQL = "select * from tblBorrowerRelation where
tblBorrowerRelation.lngBorrowerNumberCnt=" & varText_Box
me.fsubqryBorrowerRelation.requery
End Sub
The problem is that the sub form does not update after the
command button is clicked. The only way i can get the sub
form to update is by going into design view and then
returning to form view. How can i get the sub form to
update automatically? Any help is much appreciated.
Martin