The user inputs data in the form which is bound to the CompletedAudits table.
There are comboboxes on the form which the user selects in order to create a score. The questions are weighted and so I have a query that provides the “points earned” based on the responses to each cbo. Then I use a DLookup to the query to obtain the total score when the “Calculate Score” button is pressed.
All of this is working so far except when the user needs to change the response in the cbo or to recalculate the score. If I use me.requery in the after update event, the record jumps to the first record in the table. I need to refresh the query when the selection in the cbo changes or the score is recalculated but I am not sure how to do it.
I have never made a form that is calculated based on a query so I am not sure what I am doing wrong here. Below is the vba I am currently using.
Code:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Total Score for Call Opening
Private Sub btnCallOpeningScore_Click()
txtCallOpeningScore.Value = DLookup("[Call Opening Score]", "qry_CallOpeningScore", "[ID] =" & Me.txtMasterID.Value)
'Me.Requery
End Sub
I'm sure I am missing something obvious - I really appreciate any help you can provide. Thanks!