Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating a specific field for all records currently on screen

Status
Not open for further replies.

meagain

MIS
Nov 27, 2001
112
CA
I have an inventory application which users can quickly enter their counts into the onhand field via a form. I'm looking for a formula which will update all the empty "onhand" fields currently filtered to the screen to zero, so we can expedite input. We are using Access 2000, and the form is filtered by a query.

Your expertise is greatly appreciated.

Thanks,
 
can you not just set the default value to 0?

It's not what you know. It's who's on Tek-Tip's
 
You might be able to update your form's current records using a recordsetclone:
Code:
Private Sub cmdUpdateRecords_Click()
    Dim rs As DAO.Recordset
    Dim intNewQty as Integer
    intNewQty = Me.txtNewQty
    Set rs = Me.RecordsetClone

    With rs
        .MoveFirst
        Do Until .EOF
            .Edit
                .Fields("OnHand") = intNewQty
            .Update
            .MoveNext
        Loop
        .Close
    End With
    Set rs = Nothing
End Sub

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top