Updating A Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to devleop an evaluation form. Based on the type of employee there is a max score. I have two fields: one that sums an employee's current score, and one that counts down from the max telling the evaluator how many points are still available. This second field is fed by a query and this is the heart of my problem. With 59 possible evalution items I don't want to write 59 On Update Events. I tried to use an On Change Event in the sum field, but it didn't work. Any suggestions.

Thanks ahead of time
 
Hi Bob,

here is what i would do:
1. create a New Property called MaxScore using following code:

Option Compare Database
Option Explicit

dim sMaxScore as single

Property Let MaxScore (smax as single)
sMaxValue = smax
end Property

Property Get MaxScore () as single
MaxScore = sMaxScore
end Property

2. On the Form_Open event i will fill the MaxScore property for an employee using a query as you already done:
Private Sub Form_Open(Cancel As Integer)
MaxScore = Get Max Possible Score using query
End Sub

3. on the form i add 2 textboxes, txtCurrentScore and txtRestScore
In txtRestScore Control Source property i will put something like this : =[MaxScore]-[txtCurrentScore]

HTH


----- Bob Ewers wrote: -----

I'm trying to devleop an evaluation form. Based on the type of employee there is a max score. I have two fields: one that sums an employee's current score, and one that counts down from the max telling the evaluator how many points are still available. This second field is fed by a query and this is the heart of my problem. With 59 possible evalution items I don't want to write 59 On Update Events. I tried to use an On Change Event in the sum field, but it didn't work. Any suggestions.

Thanks ahead of time
 
Thanks for the help...I think I'm almost there

I've never used this Let Get Property stuff before, so I'm not sure what it's doing. I have the form set up so that you acutally pick the employee on the form so instead of On Open I used an On Change Event. I couldn't figure out how to set a query result directly equal to MaxScore. So I am running the query in a list box in the form and then set MaxScore equal to that list box's value. But I'm having the same problem as before...I have to select the list box to get the values to update. I'm sure this is not as hard as I'm making it, but your assistance is appreciated. Thanks

Bob
 
Hi Bob,

i am not good at explaining, however if you want i can send you the mdb (zipped). Just let me know where to send. my email is: (e-mail address removed) or (e-mail address removed)
 
Back
Top