Results 1 to 11 of 11
  1. #1
    damie is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    19

    Prevent edit and delete after printing a form

    Hi everyone please i need an urgent help
    I want my order details form, after printing to prevent deletion and edit.
    I got this vba code to use, when i used it, it closed up all the forms including the ones i have not printed.
    Normally i print immediately the order is made...
    i dont know what to put ,"" <> ""

    If Nz([OrderDate],"") <> "" Then 'there's a value there so the orders been printed
    Me.AllowEdits = False


    Me.AllowDeletions = False
    Else
    Me.AllowEdits = True
    Me.AllowDeletions = True
    End If

    thanks so much for your help

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try putting that in the Current Event of your form.

  3. #3
    damie is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    19
    Thanks for the reply
    i tried putting it in the current event form but it is still locking up everything.
    If Nz([OrderDate],"") <> "" ... am i suppose to put a date between the inverted commas, please how will i go about it
    Thanks

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Any chance you can post your db, or at least a sample that demonstrates this issue?

  5. #5
    damie is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    19
    Thanks for your reply
    I have added a sample of the database
    what i want is after printing the form i want it to prevent deleting and editing of the record printed
    but now everything is locked, even a new form
    i don't want to use the complete order on the form
    thanks

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Which form have you been working on?

  7. #7
    damie is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    19
    thanks for your reply
    am working on the order details form
    thanks

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If you completely comment out all of the code in the current event, does the form work as you want?

  9. #9
    damie is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    19
    Thank you for the reply
    That is not what i want
    I want it to be such that when i print the invoice of the form it prevents deleting and editing to that particular form.I don't want it to be that when they click on complete order that is when it would lock the form.
    Thanks

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by RuralGuy View Post
    If you completely comment out all of the code in the current event, does the form work as you want?
    I didn't say this correctly! I meant to say when you comment out the CurrentEvent code does the form at least go back to working? Mine does not.

  11. #11
    damie is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    19
    Thanks for your reply
    I think some have the forms have been closed completely.
    Please just try to open a new order as if you want to sell
    Thanks

    On the On current i just added set form state

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

Similar Threads

  1. How to edit data in a form
    By x3ldonx in forum Forms
    Replies: 2
    Last Post: 10-11-2010, 01:20 AM
  2. Prevent a form from closing
    By ksmithson in forum Forms
    Replies: 0
    Last Post: 07-15-2010, 12:49 PM
  3. Replies: 1
    Last Post: 06-25-2010, 09:56 AM
  4. Cannot not edit form
    By stingray_69 in forum Forms
    Replies: 3
    Last Post: 03-18-2010, 10:49 AM
  5. Form not letting me edit records
    By bbylls in forum Forms
    Replies: 3
    Last Post: 12-16-2009, 09:30 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