I have a form that contains a combo box. The combo box has about 30 different values, text values. Each one of those has a different impact on 10 or so different fields. Those 10 or so fields either contain a -1 or a 1.
What I would like to happen is that when the person who uses this utility picks a value in the combo box, the 10 or so fields are automatically updated with the values that correspond to the selection in the combo box.
So "Spill" would have say -1, 1, 1, 1, 1, -1, etc.
This is the code that I am trying to use. I have used this before in another application with good results, no problems at all. However, when I use it now, the form does not show any change at all. The fields that I want to update don't update at all. The sql is all on one line (the forum will likely break that) and if run in a window gets the result just fine.
Private Sub Charge_Type_AfterUpdate()
Dim db As dao.Database
Dim rst As dao.Recordset
Dim sales1 As Long
Dim cs1 As Long
Dim purch1 As Long
Dim plan1 As Long
Dim comp1 As Long
Dim prod1 As Long
Dim r_d1 As Long
Dim qc1 As Long
Dim lab1 As Long
Dim whouse1 As Long
Dim fina1 As Long
Dim sqlstr As String
Well this is embarrasing. This worked just fine. The problem was the field that was storing the value I needed was in fact a combo box, and the first column was a number, and I was looking for the text description which was in the 2nd column, but due to the justification, I was only seeing the description.
So once I fixed that it works like a charm. I should have eaten lunch earlier.