"NEWER USER" <(E-Mail Removed)> wrote in message
news:BCCCD6D5-DC12-4B74-ADA5-(E-Mail Removed)...
> When my Main form 'frmSearch' opens, I have it coded as follows - On Open:
> Me.fsubSearch.Form.RecordSource = "Select * from qryProduct where false"
> Me.txtBrand.SetFocus
>
> The subform 'fsubSearch' is blank. I manually fill in unbound fields on
> the
> form and Apply Filter command to retrieve records in subform. I have set
> the
> Recordset Type to Dynaset (Inconsistent Updates) on the subform's Property
> Sheet. I can manually change the number quantity in the Order field of
> the
> subform (could not when set to Dynaset only). Do I need something
> additional
> in code to update this field, even though set to Inconsistent Updates? I
> appreciate the help.
It sounds like qryProduct has some updatability issues, which circumvented
on the form by setting the form's recordset type to "Dynaset (Inconsistent
Updates)". Your code is opening a totally separate recordset on the same
recordsource, so you would need to specify inconsistent updates for that new
recordset:
Set rs = db.OpenRecordset( _
Me.fsubSearch.Form.RecordSource, _
dbOpenDynaset, dbInconsistent)
However, I'm not sure that you need or should open a separate recordset,
when you have the subform's recordset right there at your disposal. Why not
just use that:
'------ start of revised example code ------
Private Sub QF_Click()
With Me.fsubSearch.Form.RecordsetClone
If .RecordCount > 0 Then
If MsgBox( _
"Order Quantity will be updated to Per Car Quantity." &
_
vbNewLine & vbNewLine & "Continue?", _
vbYesNo + vbQuestion, _
"Confirm.") _
= vbYes _
Then
DoCmd.Hourglass True
.MoveFirst
While Not .EOF
.Edit
!Order = [Per Car]
.Update
.MoveNext
Wend
DoCmd.Hourglass False
MsgBox _
.RecordCount & " record/s have been updated.", _
vbInformation, _
"Finished."
End If
Else
MsgBox "No record to update.", vbInformation, "Message."
End If
End With
End Sub
'------ end of revised example code ------
Incidentally, doing it that way would avoid any concern about the fact that
any filter applied to the subform would not be reflected in the subform's
RecordSource property, which I was worried about when I read your
explanation.
--
Dirk Goldgar, MS Access MVP
Access tips:
www.datagnostics.com/tips.html
(please reply to the newsgroup)