Im attempting to update all rows in a column (column A, PO Number) within a table. It needs to be dynamic because the number of rows in the table will change. The value (txtPONbr) is entered by the user on a form (PODetail). Any assistance would be greatly appreciated.

Private Sub cmdPO_Detail_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String
Dim strCriteria As String
Dim strCriteria2 As String
Dim PONbr As String

strCriteria = Me.txtPONbr
strSQL = "CompanyiSupplier"
Set db = CurrentDb()
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)

Me.txtPONbr.SetFocus
If Me.txtPONbr.Text = "" Then
    MsgBox "Please enter the PO!", vbExclamation, "Blank PO Number"
End If

Dim i As Variant

Me.txtPONbr.SetFocus
If Me.txtPONbr.Text = "" Then
    For Each i In ListBox.ItemsSelected
    With rst
        .Edit
            ![PO Number] = [Forms]![frmPODetail]![txtPONbr]
            .Update
    End With
    Next
End If
End Sub
Thanks,
Ray