Announcement

Collapse
No announcement yet.

Need a quick solution for MS Access

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need a quick solution for MS Access

    I have a need to add two entries (numeric data) on a form and store the data into the same table in a totals column.

    So far I can get the total to show on the form but storing it in the table is eluding me...

    Any Clues?

    As well I have to do something similar and check one entry...

    If its JKA, SKA, or 1,2,3,4,5,6 it makes another spot =1
    If its 7,8,9,10,11,12,13 it makes the spot=1.5

    Getting it to work is driving me nuts because I know there is an easy way to get this to work... but it just won't work
    Last edited by cbman; 12 November 2001, 09:24.
    AMD Phenom 9650, 8GB, 4x1TB, 2x22 DVD-RW, 2x9600GT, 23.6' ASUS, Vista Ultimate
    AMD X2 7750, 4GB, 1x1TB 2x500, 1x22 DVD-RW, 1x8500GT, 22" Acer, OS X 10.5.8
    Acer 6930G, T6400, 4GB, 500GB, 16", Vista Premium
    Lenovo Ideapad S10e, 2GB, 500GB, 10", OS X 10.5.8

  • #2
    Hello CB
    What sort of problems/error messages are you having?
    Assuming you have a form field bound to the totals field in the table, then writing the total value to this field and doing a refresh should work.


    regards MD
    Last edited by mdhome; 13 November 2001, 07:17.
    Interests include:
    Computing, Reading, Pubs, Restuarants, Pubs, Curries, More Pubs and more Curries

    Comment


    • #3
      Hey mdhome.

      Its kinda interesting..

      I need to calculate the value of two fields on a form from a single table and put the result into the form as well as into a seperate spot on the same table.

      In my case for this database its AM Kilometres, PM Kilometres, and Total Kilometres.

      I can calculate the sum of AM-Kilometres and PM Kilometres.. but I can't get it to go into the the table at total Kilometres...

      Its driving me nuts because my guess is there is a simple solution that I can't think of at the moment.
      AMD Phenom 9650, 8GB, 4x1TB, 2x22 DVD-RW, 2x9600GT, 23.6' ASUS, Vista Ultimate
      AMD X2 7750, 4GB, 1x1TB 2x500, 1x22 DVD-RW, 1x8500GT, 22" Acer, OS X 10.5.8
      Acer 6930G, T6400, 4GB, 500GB, 16", Vista Premium
      Lenovo Ideapad S10e, 2GB, 500GB, 10", OS X 10.5.8

      Comment


      • #4
        Hello CB.
        Its been some time since I used Access and I am a little rusty. There are also many possible ways to do this. You could try putting some code into the after_update event for both the AM and PM fields. This would allow you to do the validation and write the value to the totals fields (I assume the totals field is visible on the form). Failing that could use this method to run an update query against the table. There are other ways but they escape me at present.

        Just a question. Is the totals field visible on your form?


        regards MD
        Interests include:
        Computing, Reading, Pubs, Restuarants, Pubs, Curries, More Pubs and more Curries

        Comment


        • #5
          Yes it is...

          That is part of my problem.. I can use a calculated field to calculate the total of AM+PM... but it only displays the result and will not store the result in the table...

          I have the same problem with the Query... I can Calculate the total but can not transfer it into the table.

          Oh and just so you know... I don't know much about SQL programming...

          And for everyone else... in case you were wondering.. I hate access...
          AMD Phenom 9650, 8GB, 4x1TB, 2x22 DVD-RW, 2x9600GT, 23.6' ASUS, Vista Ultimate
          AMD X2 7750, 4GB, 1x1TB 2x500, 1x22 DVD-RW, 1x8500GT, 22" Acer, OS X 10.5.8
          Acer 6930G, T6400, 4GB, 500GB, 16", Vista Premium
          Lenovo Ideapad S10e, 2GB, 500GB, 10", OS X 10.5.8

          Comment


          • #6
            Hating Access is a good thing.

            Try something like

            INSERT INTO table
            SELECT (am + pm) as total
            FROM table
            Gigabyte P35-DS3L with a Q6600, 2GB Kingston HyperX (after *3* bad pairs of Crucial Ballistix 1066), Galaxy 8800GT 512MB, SB X-Fi, some drives, and a Dell 2005fpw. Running WinXP.

            Comment


            • #7
              Will do Wombat...

              I should really find my notes.. but from what I remember... I slept through most of those classes
              AMD Phenom 9650, 8GB, 4x1TB, 2x22 DVD-RW, 2x9600GT, 23.6' ASUS, Vista Ultimate
              AMD X2 7750, 4GB, 1x1TB 2x500, 1x22 DVD-RW, 1x8500GT, 22" Acer, OS X 10.5.8
              Acer 6930G, T6400, 4GB, 500GB, 16", Vista Premium
              Lenovo Ideapad S10e, 2GB, 500GB, 10", OS X 10.5.8

              Comment


              • #8
                cb
                how big is your database? If it is small enough then you can email me a copy and I will have a look for you?


                regards MD
                Interests include:
                Computing, Reading, Pubs, Restuarants, Pubs, Curries, More Pubs and more Curries

                Comment


                • #9
                  I fell at this hurdle once before, so I just calculated stuff for every form/query/report that used the data.

                  If you get a result, please let us all know.

                  T.
                  FT.

                  Comment


                  • #10
                    mdhome... I would send this to you but the problem is it already contains the complete local school bus barns private records on each of the 1000 and some odd school kids in the area.

                    When I get to work I will see about posting some screenshot veiws of the form and of the design layout for the table.

                    Oh and anyone know of how to catch the date and input it into a table but then lock that so that it isn't overwritten next time you view that form... Just so that I can keep track of when the kid was input into the database.
                    AMD Phenom 9650, 8GB, 4x1TB, 2x22 DVD-RW, 2x9600GT, 23.6' ASUS, Vista Ultimate
                    AMD X2 7750, 4GB, 1x1TB 2x500, 1x22 DVD-RW, 1x8500GT, 22" Acer, OS X 10.5.8
                    Acer 6930G, T6400, 4GB, 500GB, 16", Vista Premium
                    Lenovo Ideapad S10e, 2GB, 500GB, 10", OS X 10.5.8

                    Comment


                    • #11
                      Originally posted by cbman

                      Oh and anyone know of how to catch the date and input it into a table but then lock that so that it isn't overwritten next time you view that form... Just so that I can keep track of when the kid was input into the database.
                      Use the date () or now() functions and check for a null or empty value in the date field. If it is blank then update else ignore.

                      regards MD
                      Interests include:
                      Computing, Reading, Pubs, Restuarants, Pubs, Curries, More Pubs and more Curries

                      Comment


                      • #12
                        If only there was a smilie smacking his head like an idiot...

                        I completely forgot about the null value

                        This should make a few other things easier.

                        Its just so unfortunate that the only person at the company that knows Access is me and I have to teach the basics of it if someone wants lessons.

                        If ever I goto hell... I can see Satan making me teach Access to get cheap thrills.
                        AMD Phenom 9650, 8GB, 4x1TB, 2x22 DVD-RW, 2x9600GT, 23.6' ASUS, Vista Ultimate
                        AMD X2 7750, 4GB, 1x1TB 2x500, 1x22 DVD-RW, 1x8500GT, 22" Acer, OS X 10.5.8
                        Acer 6930G, T6400, 4GB, 500GB, 16", Vista Premium
                        Lenovo Ideapad S10e, 2GB, 500GB, 10", OS X 10.5.8

                        Comment


                        • #13
                          if only_person_in_company_who_knows_access then
                          if you_go_to_hell then
                          satan_smacks_bum
                          end if

                          else
                          retain_composure

                          end if
                          Interests include:
                          Computing, Reading, Pubs, Restuarants, Pubs, Curries, More Pubs and more Curries

                          Comment

                          Working...
                          X