Results 1 to 3 of 3
  1. #1
    Fly is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    2

    Operations whith two texts box's and save

    Hi friends sorry i'm very noob. I'm starting use the access.
    I have create a form. There is a text box to introduce the time of entry(A), other to time of departure(B) an another one to put the total stay time(C).
    My questions are: how can i do to the time in C is automatically calculated by deducting from B to A, and after that the calculated value appears in the correspondent cell in the table i have created to store all data generated in the form.

    Another litle question is possible to erase all data in the table and put the
    ID key to zero?

    Thank's.

  2. #2
    dblife's Avatar
    dblife is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    South Shields, UK
    Posts
    88
    You need to create a table with a unique primary key, a field for time A and another for time B.
    Use this to create a query and use the DateAdd() function to calculate the difference between the two.
    Use this query as the basis for a form.
    It is not usually 'good practise' to store values you can get Access to calculate 'on the fly' whether in a query as part of a form or report.

    As for setting an autonumber field to zero, there is a way but what is the point, the user is never meant to see an autonumber field.

  3. #3
    Fly is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2011
    Posts
    2
    Quote Originally Posted by dblife View Post
    You need to create a table with a unique primary key, a field for time A and another for time B.
    Use this to create a query and use the DateAdd() function to calculate the difference between the two.
    Use this query as the basis for a form.
    It is not usually 'good practise' to store values you can get Access to calculate 'on the fly' whether in a query as part of a form or report.

    As for setting an autonumber field to zero, there is a way but what is the point, the user is never meant to see an autonumber field.

    I have already a form with a field A the field B and the field C (the value is calculate because i have wrote on control origins on fields proprieties =[B]-[A]
    So on the form the value appears but i don't know how to put this value on the table i have create the fields but i don't know how to get the value calculated on the form

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 05-15-2011, 11:03 PM
  2. Query to perform several special operations
    By Allison in forum Queries
    Replies: 4
    Last Post: 05-13-2011, 04:30 PM
  3. Replies: 9
    Last Post: 01-20-2011, 02:22 PM
  4. Replies: 2
    Last Post: 11-25-2010, 11:01 AM
  5. sending texts from my pc with Access
    By bwian1234 in forum Access
    Replies: 1
    Last Post: 08-26-2010, 05:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums