Results 1 to 9 of 9
  1. #1
    billgyrotech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    45

    Button on a Form to make record read only

    Can a button be programmed to save current record and make it read only to prevent editing of data in that record. This would be useful so that I can close out a certain record (work order) for a customer.

    Thanks,
    billgyrotech
    Last edited by billgyrotech; 08-09-2011 at 02:03 PM.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    There would need to be some way of identifying the record to prevent it from being edited. Some would use a status field, or perhaps a closed date (no date means okay to edit). Basically you'd set the allow edits property of the form behind your button and in the current event of the form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    billgyrotech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    45
    I do have a finished date field. How do I make it work?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Along the lines of

    Code:
    If IsDate(Me.FinishedDate) Then
      Me.AllowEdits = False
    Else
      Me.AllowEdits = True
    End If
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    billgyrotech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    45
    I put the code under the DatePickedUp field On Exit Event Procedure but it didn't work. What am I doing wrong?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No idea, since I don't know what "didn't work" means. Error, wrong result, or ?

    I'd have it in the after update event of the control, and the current event.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    billgyrotech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    45

    Record Read Only

    I have the file attached. On the subform Workorder there is a DatePickedUp field that I tried to enter the code, but it doesn't make the data read only on the form for the current record.
    Last edited by billgyrotech; 08-09-2011 at 03:13 PM.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I'll try to look at it tonight. I only have 2000 on this machine and I turned off my laptop with VM's for other versions on it. Heading out to see a movie with my daughter anyway.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    billgyrotech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    45
    Thanks for any help! Have a great night!

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

Similar Threads

  1. Best way to make a query read only?
    By Remster in forum Queries
    Replies: 4
    Last Post: 12-17-2010, 04:36 AM
  2. Programmatically make queries read-only.
    By cementblocks in forum Queries
    Replies: 1
    Last Post: 05-14-2010, 10:13 PM
  3. Replies: 3
    Last Post: 06-27-2009, 03:53 PM
  4. make Add Record button work
    By janjan_376 in forum Forms
    Replies: 3
    Last Post: 06-05-2009, 04:22 AM
  5. Replies: 2
    Last Post: 10-19-2006, 04:37 PM

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