Updating a recordset

Open Recordset(Client Table Query) 'Creates a recordset with 10 sales rep records named "Sales Rep List" str SQL = "Select Sales Rep ID from Sales Rep_Table" Set Data B = Current DB() Set Sales QD. Open Recordset("Select Sales Rep ID from Sales Rep_Table ") Do Until rst Sales Rep. Sales Rep ID = '" & rst Sales Rep("Sales Rep ID") & "'" Do Cmd. Move Next Loop Msg Box "Finished Looping" rst Sales Rep.

Create Query Def(Sales Table Query, str SQL) Set rst Sales Rep = Data B. EOF = True str SQL = "Update Client_Table, Sales Rep_Table SET Client_Table.

This works even when the query returns records from more than one table.

Unfortunately, there are situations where the query results are not updateable.

EOF ' Check the current column For Each fld Enumerator In rst Videos.

Fields ' If the column is named Title If fld Enumerator.

An alternative is to navigate among records looking for a particular value.Once a record matches a criterion you have set, edit it using the same above approach.This would be done as follows: Private Sub cmd Move Position_Click() Dim db Video Collection As Object Dim rst Videos As Object Dim fld Enumerator As Object Dim fld Columns As Object Set db Video Collection = Current Db Set rst Videos = db Video Collection.You wouldnt expect to edit that since you are not viewing individual records.However, if any portion of your query contains a summary (GROUP BY) field, all the fields of the returned records are not editable (not just the summary fields).Open Recordset("Videos") Set fld Columns = rst Videos.

412

Leave a Reply