I need to fill a table with values. The table has about 6000 records
but the records will not have the same value in this field. I thought
I had figured out a way to do this easily but it is giving me an
error.
Object or provider is not capable of performing requested operation.
Basicly I am choosing a department in a combo box(Combo1) and a charge
number(Combo3) in the form. They are both unbound.
I want to add the charge number to the CALFILES table which is chosen
in the charge number box for all records with the department chosen in
Combo1
Here is the code.
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Dim con As Object
Dim rs As Object
Dim stSql As String
Dim intOption As Integer
Set con = Application.CurrentProject.Connection
stSql = "SELECT * FROM [CALFILES] WHERE [Department]=" &
Me![Combo1]
Set rs = CreateObject("ADODB.Recordset")
rs.Open stSql, con, 1 ' 1 = adOpenKeyset
While (Not (rs.EOF))
rs![ChargeNumber] = Me![Combo3]
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
Set con = Nothing
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub