select case not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RuralGuy
    Recognized Expert Contributor
    • Oct 2006
    • 375

    #31
    The Name of your control is Combo22. "age" is the field to which that control is bound. The field is not actually updated until you either move to another record or close the form.

    Comment

    • Mac rod
      New Member
      • Mar 2011
      • 35

      #32
      Yup, when it is in the afetupdate event. but the code is in the button. and if ever it updates it returns the wrong values. Different to those that i wrote on the code.

      Comment

      • RuralGuy
        Recognized Expert Contributor
        • Oct 2006
        • 375

        #33
        All of the fields in the Development table save two, are text fields. You are doing numerical testing against "text". Your table fields should be probably the Single DataType fields.

        Comment

        • Mac rod
          New Member
          • Mar 2011
          • 35

          #34
          Actually they were numbers before general number and double. Then i tried text, the results were the same.

          Comment

          • RuralGuy
            Recognized Expert Contributor
            • Oct 2006
            • 375

            #35
            Try changing them to Single or Double again and see what happens.

            Comment

            • Mac rod
              New Member
              • Mar 2011
              • 35

              #36
              Still it doesn't show the correct values. have you seen the code? i think i did it correctly? the problem is that for example in the code <= 6.99 should be "short" but after i pressed the button it shows "Normal" or "big". and the thing is "big" is in the other "if" statement.

              Comment

              • RuralGuy
                Recognized Expert Contributor
                • Oct 2006
                • 375

                #37
                You should name your Controls differently that the fields to which they are bound. Access does not know whether you are referring to the field or the control.

                Comment

                • RuralGuy
                  Recognized Expert Contributor
                  • Oct 2006
                  • 375

                  #38
                  See if this "1st Month" works as you would expect.
                  Attached Files

                  Comment

                  • Mac rod
                    New Member
                    • Mar 2011
                    • 35

                    #39
                    Actually to all the data i placed there already, the 1st month returns the best answer. Can you try the 2nd month? and also where do i change the control name?

                    Comment

                    • Mac rod
                      New Member
                      • Mar 2011
                      • 35

                      #40
                      the 1st month returns the values correctly now

                      Comment

                      • Mac rod
                        New Member
                        • Mar 2011
                        • 35

                        #41
                        i see the control now i did that also but i didn't change the code. that's why.

                        Comment

                        • RuralGuy
                          Recognized Expert Contributor
                          • Oct 2006
                          • 375

                          #42
                          The name of a control is on the "Other" tab of the property sheet of the control. If you use the Me. preface in the code then Intelisense will show you the possible legal answers.

                          Comment

                          • Mac rod
                            New Member
                            • Mar 2011
                            • 35

                            #43
                            I found it!!! Thanks to you rural guy! I tried and change the 2nd month as well and found that i messed a lot since i only copy, paste and edit it so, it ended up that some of them have the same name. I should be more careful when coding. aside from the fact that i'm using the field name. Thanks a lot again!!!!!

                            Comment

                            • NeoPa
                              Recognized Expert Moderator MVP
                              • Oct 2006
                              • 32633

                              #44
                              A good point to note here is that if you were in the (good) habit of using capital letters within your object names then the name "age", being all lower-case, would have jumped out as an obvious problem right from the start. It makes sense to use the facilities available to help with your work.

                              Comment

                              Working...