Z
zixingw via AccessMonster.com
I inserted a form (treate it as a subform) into a main form, an also added a
combobox to the main form as a parameter select control for the record source
of that subform. The basic codes in a click cmdButton are as follows:
......
Dim db as DAO.Database
Dim qryDef as DAO.QueryDef
Dim strSQL as String
strSQL ="Select .. from .. Where MyId='" & combBox.Value & "'"
Set db=currentDB
Set qryDef=db.QueryDefs("MyQuery")
qryDef.SQL= strSQL
Me.frmSubFormName.Form.Requery
Me.Requery
..................
When I select a value from combBox and click the cmdButton, The data in the
subform does not updated, until I close the main form and open the main form
again.
I did a lot of ways that posts on Website, such as using Docmd.Reqeury "Me.
subform.Form" etc, to resolve this issue, but all are failed.
Any one can help me.
Thanks,
Zixing
combobox to the main form as a parameter select control for the record source
of that subform. The basic codes in a click cmdButton are as follows:
......
Dim db as DAO.Database
Dim qryDef as DAO.QueryDef
Dim strSQL as String
strSQL ="Select .. from .. Where MyId='" & combBox.Value & "'"
Set db=currentDB
Set qryDef=db.QueryDefs("MyQuery")
qryDef.SQL= strSQL
Me.frmSubFormName.Form.Requery
Me.Requery
..................
When I select a value from combBox and click the cmdButton, The data in the
subform does not updated, until I close the main form and open the main form
again.
I did a lot of ways that posts on Website, such as using Docmd.Reqeury "Me.
subform.Form" etc, to resolve this issue, but all are failed.
Any one can help me.
Thanks,
Zixing