Results 1 to 7 of 7
  1. #1
    LaughingBull is offline Competent Performer
    Windows 8 Access 2003
    Join Date
    Jul 2015
    Location
    Toledo Ohio
    Posts
    143

    Access 2013 prevent a book from being checked out by 2 diff people

    This is the code for the select combo box that selects a book to be checked out. After update if the book selected has already been checked out and no date in the returned date field then msgbox this book is already checked out.

    Private Sub Combo13_AfterUpdate()
    On Error GoTo Combo13_AfterUpdate_Err

    DoCmd.SearchForRecord , "", acFirst, "[ID] = " & Str(Nz(Screen.ActiveControl, 0))


    Combo13_AfterUpdate_Exit:
    Exit Sub

    Combo13_AfterUpdate_Err:
    MsgBox Error$
    Resume Combo13_AfterUpdate_Exit

    End Sub

    Thanks for your help

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,965
    What is your question? Is the code not working for you?

    Probably should use BeforeUpdate event.

    Or set up the combobox RowSource to not include books that are already checked out.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    LaughingBull is offline Competent Performer
    Windows 8 Access 2003
    Join Date
    Jul 2015
    Location
    Toledo Ohio
    Posts
    143
    afterUpdate If If Forms!tblLibrary1!CheckedOut = True Then
    MsgBox "This book is checked Out Select another"


    End If
    Works great thanks

  4. #4
    LaughingBull is offline Competent Performer
    Windows 8 Access 2003
    Join Date
    Jul 2015
    Location
    Toledo Ohio
    Posts
    143
    June7

    I seen on one of your post reply's a database for the Library check out or something like that. will you send me that link so I can download it please?

    Thank you

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,965
    Your profile shows Access 2003. Is that still what you are working with?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    LaughingBull is offline Competent Performer
    Windows 8 Access 2003
    Join Date
    Jul 2015
    Location
    Toledo Ohio
    Posts
    143
    no 2013 I will go change that thank you

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,965
    Then open Access > File > New > Database > Desktop Lending Library

    At least that's what I would do in 2010.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 2
    Last Post: 08-13-2015, 02:14 PM
  2. Export From Access 2013 To Excel 2013
    By Esmatullaharifi in forum Programming
    Replies: 8
    Last Post: 04-17-2015, 09:40 PM
  3. Replies: 0
    Last Post: 11-19-2014, 05:47 AM
  4. Replies: 1
    Last Post: 01-26-2012, 10:22 PM
  5. Replies: 0
    Last Post: 12-28-2009, 12:14 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