Results 1 to 3 of 3
  1. #1
    Melo is offline Novice
    Windows 7 Access 2003
    Join Date
    Sep 2010
    Posts
    5

    Submit button in access form

    Hi everyone!

    I am new with access and would appreciate help on my forms.

    I have a transactions table with 24 fields on it. To enter records, I created 5 forms that enter records to that same table depending on the circumstances, like billing, expenses, etc.

    My problem is that when I accidentally close any form, regardless of whether its fully accomplished or not, it enters a record on the table and takes or uses a transaction id (primary key in the table) even if the information in the form is incomplete. Because of this, my table is now full of erroneous entries.



    My questions are:

    1. Should I create a submit button in the forms that will command the actual recording of the informations in the form to the table?
    2. If that is the solution, how can develop a process that will see to it that all the fields in the form are duly accomplished before actual submission?
    3. Do you have any better suggestion?

    Thank you and best regards to all.

    Melo

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    There are other people here (older people) that know this process better than I do as I have never fully understand the meanings between different versions of Access, but...

    What you want is a combination between two things:

    me.undo and cancel = true

    It is my understanding that ME.UNDO undoes the changes to the current record. On a new record, this includes the addition of the actual record entry to the table. On a record already present in the table, it includes any changes after the DIRTY event is triggered. I have never understood the meaning of CANCEL = TRUE and I have yet to find someone who is confident enough to explain its true meaning. I never use it my databases as I found other ways to do the same thing.

    You will definately want to make use of ME.UNDO though. Hopefully someone like Paul will jump in here and give both you and I some insight on this. Experiment with the undo action and see what it does. That's the best way to understand it really. For instance, go to a new record (at that point, the record is in the table), then hit a button that runs the undo code. Close the form and look at the table. What happens? Do it again after you've entered half the info in the new record, etc, etc...

    I use temp tables in one of my inventory database, and what they do is store all of the information that's being entered at any given time until the user is done entering in information. At that point, the data is appending from that temp into the permanent stock table and the temp table is cleared using a delete query. I use autonumbers in every table that I create, so I have the flexibility to always delete the last record entered in a table simply by running a delete query and specifying criteria that calls for the record with the highest ID number. That is not as clean as using ME.UNDO but my specific structure doesn't accomodate it. Yours sounds like it will...

  3. #3
    Melo is offline Novice
    Windows 7 Access 2003
    Join Date
    Sep 2010
    Posts
    5
    Thanks Partner. I'll give it a try and will let you know.

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

Similar Threads

  1. Replies: 1
    Last Post: 06-20-2010, 05:04 AM
  2. Button on the form
    By Evgeny in forum Forms
    Replies: 6
    Last Post: 04-29-2010, 12:06 AM
  3. Replies: 1
    Last Post: 03-03-2010, 07:29 PM
  4. Replies: 6
    Last Post: 02-09-2010, 07:53 AM
  5. Net Send from a button on an Access form
    By Deb4995 in forum Forms
    Replies: 0
    Last Post: 10-19-2006, 10:19 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