Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2008
    Location
    All over, Now in Missouri
    Posts
    73

    Unanswered: Evaluating Using Recordsets

    - I made a table from some data I am trying to evaluate.
    - When I try to evaluate the yes/no box it will only give me one value

    (Basically, I have yes/no Combo boxes and string combos that I am going to evaluate and assign a integer value so a total score can be achieved)

    code:

    Dim db As DAO.Database
    Dim rs As DAO.Recordset
    Set db = CurrentDb()
    Set rs = db.OpenRecordset("tblclassranking")
    If rs.RecordCount = 0 Then Exit Sub
    rs.MoveFirst
    ' loop through each record in the first recordset

    Do Until rs.EOF
    rs.Edit
    If Me.Fail.Value = True Then ' Yes/No Combo
    rs![FailTotalScore] = (10 + rs![Score]) ' add 10 points to field
    Else
    rs![FailTotalScore] = (100 + rs![Score]) ' add 100 points to field
    End If

    rs.Update
    rs.MoveNext
    Loop

    rs.Close

    Set rs = Nothing
    Set db = Nothing

    ^^^^^^^
    The Above code always returns the else value to my new [FailTotalScore], never the True Value.

    Peter
    We tend to look at Linear paths which can lead us to a path of resistance!

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    What's the RowSource of the Combo Fail?
    Have a nice day!

  3. #3
    Join Date
    Apr 2008
    Location
    All over, Now in Missouri
    Posts
    73
    Hi

    The field I am evaluating is a Yes/No Check Box.

    Peter
    We tend to look at Linear paths which can lead us to a path of resistance!

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Quote Originally Posted by PJHAction View Post
    -(Basically, I have yes/no Combo boxes and string combos that I am going to evaluate and assign a integer value so a total score can be achieved)Peter

    The field I am evaluating is a Yes/No Check Box.
    Which one is it, Checkbox or Combobox?
    Have a nice day!

  5. #5
    Join Date
    Apr 2008
    Location
    All over, Now in Missouri
    Posts
    73
    Thanks for your help, but I have decided to use multiple queries to achive my objective. I may try to learn recordsets at a later time.

    Peter
    We tend to look at Linear paths which can lead us to a path of resistance!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •