Results 1 to 5 of 5

Thread: double booking

  1. #1
    Join Date
    Jan 2004
    Posts
    106

    Unanswered: double booking

    i need to come up with a way of making sure that when the user enters a book number in the loan form of the library database, if that book number is already on loan a message comes up saying "book out"
    (if there is a value in "date borrowed" but not in "date returned" in the loan table)

    please help!

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8

    Try

    (if there is a value in "date borrowed" but not in "date returned" in the loan table)

    Code:
    If Isnull(date borrowed]) Then
    
    Else
    
    If Isnull(date returned)  Then
    msgbox("book out")
    Else
    
    End If
    
    
    End If
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  3. #3
    Join Date
    Jan 2004
    Posts
    106
    good idea but that will bring up several records where the book hasnt been returned. how do i make it so that the message box will only come up if the book number that the user types into the loan form comes up as being out?

  4. #4
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8

    Function it

    add a function

    Code:
    Function Book_out(bookid)
    
    [date borrowed] = dlookup(..bookid)
    [date returned] =  dlookup(..bookid)
    
    if this mite error cause of null records
    so just add a 
    On Error
    or 
    use the IIF() with the lookup
    
    then you can 
    do the 
    
    ifing
    
    if .....
    
    End If
    
    End Function
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  5. #5
    Join Date
    Jan 2004
    Posts
    106
    hey, thanks for the code, the only problem is i have no ideas about code. can you explain that in some way so i can put it into a query?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •