booking form

P

Paul

Hi all,

I manage two small learning centres that supports adults
in basic IT skills, on a drop in basis. I want to be able
to create a form that I can easily book people into
machines at a particular time on a particular day.

The main problem is my relationships. I have created
three tables:-

1.Location
* location names
* times (hourly slots from 9-5)
* trainer name
* Dates available (every day is available except
Sundays

2.PC Details
* Machine No (1-16)

3.Learner Details
* Name
* address
* membership No

Im not sure where to start & what to relate. One of the
biggest problems is only allowing a maximum amount of
users to an = time at the same PC, to avoid overbooking.

Going Nuts, very quickly!!

Paul
 
P

Paul

Hi,

thank you very much for your rapid response. I shall give
this a try. In the before update procedure, can I tell the
form not to allow booking if machine count is = no of
machines booked for that time?

Regards

Paul
 
A

Allen Browne

Yes, you can cancel the form's BeforeUpdate event if you have too many
bookings.

If this is an old record being edited and the time has not changed, you
don't want to run this check, so:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.NewRecord Or Me.BookingTime.Value <> _
Me.BookingTime.OldValue Then

If DCount("*", "Booking", "(MachineID = " & _
Me.MachineID & ") AND (BookingTime = " & _
Format(Me.BookingTime, "\#mm\/dd\/yyyy\#") & ")") > 3 Then

If MsgBox("You already have 3 bookings. Proceed?", _
vbYesNo+vbDefaultButton2, "Overbooked") = vbNo Then
Cancel = True
End If

End If
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top