Solved

i need a special code for a Visual basic

Posted on 2001-06-07
4
174 Views
Last Modified: 2013-11-25
first of all, i would like to thank the people who will involve in this question. my problem is i have designed a library system for dubai polytechnic by database and visual basic as a (GUI). when i designed it i faced this problem that in the reservation table and in the VB form it self that two borrower can reserve the same copy at the same time. and this is not correct so, i need a code to allow only one person can reserve a copy then the specific copy will be reserved for the person. on other hand, anyone who will reserve the specific copy, there are a specific msgbox telling the perosn who want's to reserve that "not allowed the requiered copy is already reserved"
please i need soulition for this problem because i will submit this project on sunday
Best Regards
Mohammed
     
0
Comment
Question by:Faris
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Expert Comment

by:morgan_peat
ID: 6164144
You've probably got all the reservation code & stuff sorted out, so I'm assuming that this is a quick patch.

Why not place an extra field in you 'book copy' table (or whatever it's called) to say 'reserved'.
Just make it a boolean field.  When someone reserves a copy of a book, mark this field as 'True'.
If someone tries to reserve a book, and the field is already set, say 'no'.

Just an idea...
0
 
LVL 2

Accepted Solution

by:
damienm earned 25 total points
ID: 6164195
If all books have unique id you could use something like

"update table set borrowed = true,personid=" & peronName & "where bookid = " & idval & " and borrowed = false"

"select personid where bookid=" & idval

if rs("personid") <> personName
   then msgbox "Book already booked"
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6165303
hearing...
0
 
LVL 15

Expert Comment

by:ameba
ID: 6165374
Please, maintain your other questionS!  See, now it's plural!!!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question