MS Access 2010 form field value based on another field value
Posted on 2013-02-06
i have a field called "steps" (combo box) and another called "percencomplete" (text box) in a table. On a form I want the value in the "percencomplete" to autopopulate based on what is chosen in the "steps" (called cbosteps on the form) field upon update. So I have created a table that has a column of all the values that would possibly be in the "steps" field (field name= Stepname) with another column of corresponding percentage values that are intended for the "percencomplete" field (field named also percencomplete). I named it "tblALLSTEPS". Then I tried ;
Private Sub cboStep_AfterUpdate()
On Error Resume Next
PercenComplete.RowSource = "Select tblALLSTEPS.percencomplete " & _
"FROM tblALLSTEPS " & _
"WHERE tblALLSTEPS.stepname = '" & cboStep.Value & "' " & _
"ORDER BY tblALLSTEPS.percencomplete;"
It didn't work. Any ideas how to make it work?