I
igg via AccessMonster.com
Private Sub A_MainFormButton_To_Update_Subform_Click()
Dim qd As DAO.QueryDef
Set db = CurrentDb
Set qd = db.QueryDefs("Query1")
Dim qstring As String
qstring = "SELECT Table1.* FROM Table1 WHERE id = 1 ORDER BY Table1.ID;"
qd.SQL = qstring
Me.Query1Subform.Form.Requery 'a
'Forms!Form1!Query1Subform.Form.RecordSource = qstring 'b
Set qd = Nothing
Set db = Nothing
End Sub
line 'a , using Requery, does not update the subform.
line 'b ,using RecordSource, updates the subform but in one occasion the
subform fields became locked. Couldn't change the field contents. Could
using 'b cause subform fields get locked?.
Dim qd As DAO.QueryDef
Set db = CurrentDb
Set qd = db.QueryDefs("Query1")
Dim qstring As String
qstring = "SELECT Table1.* FROM Table1 WHERE id = 1 ORDER BY Table1.ID;"
qd.SQL = qstring
Me.Query1Subform.Form.Requery 'a
'Forms!Form1!Query1Subform.Form.RecordSource = qstring 'b
Set qd = Nothing
Set db = Nothing
End Sub
line 'a , using Requery, does not update the subform.
line 'b ,using RecordSource, updates the subform but in one occasion the
subform fields became locked. Couldn't change the field contents. Could
using 'b cause subform fields get locked?.