AQA computing CPT3 Village hall coursework Watch

wo22a
Badges: 0
#41
Report 12 years ago
#41
hi, :rolleyes:

Ive been able to get a total amount of each booking taken, but, when i put it in a report using =[afternoon count]![CountOfBooking Type] (where afternoon count is the name of my query and countofbooking type is the name of the field) i get #Name? when i preview my report. :confused:

If any1 knows how to solve this please help as after this i could have it cracked after 2 weeks of trying. :eek:

Cheers

woz
0
quote
reply
lozbritt9
Badges: 0
#42
Report 12 years ago
#42
Hey i fixed my last problem (silly mistake put date_ordered instead of text3.text, to into access i guess!)

Anyway, i have got this code to stop people from booking a slot that is alreasy taken by Brownies and guides and playgroup etc....

If (Combo1.Text = "Morning") And ((Weekday(Text3.Text) = 2) Or (Weekday(Text3.Text) = 4)) Then MsgBox ("Error! This slot is allocated to: Play Group")
If (Combo1.Text = "Morning") And ((Weekday(Text3.Text) = 2) Or (Weekday(Text3.Text) = 4)) Then Text3.Text = ""

If (Combo1.Text = "Evening") And (Weekday(Text3.Text) = 3) Then MsgBox ("Error! This slot is allocated to: Guides & Brownies")
If (Combo1.Text = "Evening") And (Weekday(Text3.Text) = 3) Then Text3.Text = ""

If (Combo1.Text = "Evening") And (Weekday(Text3.Text) = 5) Then MsgBox ("Error! This slot is allocated to: Clubs & Scouts")
If (Combo1.Text = "Evening") And (Weekday(Text3.Text) = 5) Then Text3.Text = ""

The problem is when i try it the first time it works fine (message box shows etc....) but then if i change the date to one of the different dates that are taken an error occurs. It says "Run-time error '13'" "Type Mismatch" then when you click debug it goes down to the next line of code i.e. "If (Combo1.Text = "Evening") And (Weekday(Text3.Text) = 3) Then"

Appreciate help thankyou.

and also how the hell do you relate the tables in VB?
0
quote
reply
Stuartread05
Badges: 0
#43
Report 12 years ago
#43
Hey,
I was wondering if anyone doing the coursework has figured out, or obtained some VB code to prevent a double booking. I can create a booking, although there is no way of preventing someone else from booking the same time. I am getting a little concerned as the deadline isn't that far away, and neither me or anyone else in my class seem to be getting anywhere, since we are all stuck on the double booking issue.

Please help!
Thanks in advance
0
quote
reply
MRS1608
Badges: 0
#44
Report 12 years ago
#44
(Original post by Stuartread05)
Hey,
I was wondering if anyone doing the coursework has figured out, or obtained some VB code to prevent a double booking. I can create a booking, although there is no way of preventing someone else from booking the same time. I am getting a little concerned as the deadline isn't that far away, and neither me or anyone else in my class seem to be getting anywhere, since we are all stuck on the double booking issue.

Please help!
Thanks in advance
The easiest way to prevent the double booking is to use a composite key: i.e. the booking session (eg Morning, or Evening) and the date; the composite key acts like a PK so once a [session and date] is used up you can't put it in again. You don't need VB for this method.

If your DB isn't designed like that (you probably have a booking ID for each booking) then one way around this is to create some visual means of checking if that time slot is booked - say a query that checks to see if it is already booked. This won't prevent a double booking but you have a method to verify that a time slot is available or not, you should get marks for that.

The other way, of course, is the VB on the form, but unless you can post all the details of your tables I can't help.
0
quote
reply
JamieB
Badges: 0
Rep:
?
#45
Report 12 years ago
#45
(Original post by Stuartread05)
Hey,
I was wondering if anyone doing the coursework has figured out, or obtained some VB code to prevent a double booking. I can create a booking, although there is no way of preventing someone else from booking the same time. I am getting a little concerned as the deadline isn't that far away, and neither me or anyone else in my class seem to be getting anywhere, since we are all stuck on the double booking issue.

Please help!
Thanks in advance
Look into RecordLocking, not sure whether it is A2/AS level on where you learn about deadlocks so ill assume no knowledge. Essentially, if someone accesses the database to change information (write and read), the database becomes locked, therefore another user cannot access to it, in some cases they may be able to view information, but this will become useless when the other user makes the booking.

This is well and beyond the scope of an AS course, so I wouldn't be too bothered about implementing it. But its a good extra to put in if your a budding student wanting to impress

--------------

(Original post by lozbritt9)
Hey i fixed my last problem (silly mistake put date_ordered instead of text3.text, to into access i guess!)

Anyway, i have got this code to stop people from booking a slot that is alreasy taken by Brownies and guides and playgroup etc....

If (Combo1.Text = "Morning") And ((Weekday(Text3.Text) = 2) Or (Weekday(Text3.Text) = 4)) Then MsgBox ("Error! This slot is allocated to: Play Group")
If (Combo1.Text = "Morning") And ((Weekday(Text3.Text) = 2) Or (Weekday(Text3.Text) = 4)) Then Text3.Text = ""

If (Combo1.Text = "Evening") And (Weekday(Text3.Text) = 3) Then MsgBox ("Error! This slot is allocated to: Guides & Brownies")
If (Combo1.Text = "Evening") And (Weekday(Text3.Text) = 3) Then Text3.Text = ""

If (Combo1.Text = "Evening") And (Weekday(Text3.Text) = 5) Then MsgBox ("Error! This slot is allocated to: Clubs & Scouts")
If (Combo1.Text = "Evening") And (Weekday(Text3.Text) = 5) Then Text3.Text = ""

The problem is when i try it the first time it works fine (message box shows etc....) but then if i change the date to one of the different dates that are taken an error occurs. It says "Run-time error '13'" "Type Mismatch" then when you click debug it goes down to the next line of code i.e. "If (Combo1.Text = "Evening") And (Weekday(Text3.Text) = 3) Then"

Appreciate help thankyou.

and also how the hell do you relate the tables in VB?
Try...

Code:
if (Combo1.Text = "Evening") And (Weekday(CInt(Text3.Text)) = 3)
0
quote
reply
teachercol
Badges: 9
Rep:
?
#46
Report 12 years ago
#46
(Original post by Stuartread05)
Hey,
I was wondering if anyone doing the coursework has figured out, or obtained some VB code to prevent a double booking. I can create a booking, although there is no way of preventing someone else from booking the same time. I am getting a little concerned as the deadline isn't that far away, and neither me or anyone else in my class seem to be getting anywhere, since we are all stuck on the double booking issue.

Please help!
Thanks in advance
One way in VB is to create blank records for all the possible booking slots. Create them with a default value of 'free' in a field. When you make a booking, its easy to check if the value is 'free'. If not, cant book. If it is free, overwrite with 'booked'.

Its clumsy but it makes counting booked slots and free slots easy.
0
quote
reply
Mike the man
Badges: 0
#47
Report 12 years ago
#47
hii am in nr da same situation as u. i ent dat gd at access. how far have u gt in ur project?
0
quote
reply
Mike the man
Badges: 0
#48
Report 12 years ago
#48
hey mate culd u show me wat a data flow diagram for the village hall project will look like please?
0
quote
reply
KymmyC
Badges: 0
Rep:
?
#49
Report Thread starter 12 years ago
#49
Hiya,

i would like to create a drop down column (in Access) that will show all the available dates for this year. my teacher said something about importing the dates from excel.
can anyone help?

thanks xXx
0
quote
reply
lozbritt9
Badges: 0
#50
Report 12 years ago
#50
Hey im working on regular bookings at the moment. I was wondering what ways people have found to stop people from booking at the same time as the women's institute (every thrird tuesday a month), i have done the main ones this one im stuck with!

Thanks any help will be greatly appreciated.
0
quote
reply
rob.
Badges: 0
#51
Report 12 years ago
#51
hey, were just starting this coursework now, our teacher has taught the class COMAL and a little MS Access... since COMAL doesnt have date functions and cant interface with any database its use can be discarded (as far as i know, its a 20 year old language intended to teach people programming concepts)

... we havent been taught any VB or any other language

i however have experience with PHP/MySQL setup so have started some work on that.

my question, is that combination acceptable to the board? and also, will i be able to use the same combination in A2 or need to use somthing else? i was told that in the past you couldnt use a database both years, the spec seems to indicate this is no longer valid?
0
quote
reply
Sithius
Badges: 14
Rep:
?
#52
Report 12 years ago
#52
Rob, good layout for starters, mines pretty similar.

I got another question on this, do we have to provide step by step pictures to accommodate the documentation? Or do we just take pictures when we have finished?
0
quote
reply
Sithius
Badges: 14
Rep:
?
#53
Report 12 years ago
#53
Cheers rob
0
quote
reply
Sithius
Badges: 14
Rep:
?
#54
Report 12 years ago
#54
I'm setting up the tables now, I've got Customer ID 3 times (once in every table) I presume this is wrong since I can't set up a relationship like this?
0
quote
reply
rob.
Badges: 0
#55
Report 12 years ago
#55
ok, this isnt that great a query but it works. not sure how Access SQL differs from MySQL, should be very similar

SELECT *
FROM tvh_bookings
LEFT JOIN tvh_customers ON tvh_bookings.customerid = tvh_customers.customerid
LEFT JOIN tvh_billing ON tvh_bookings.bookingid = tvh_billing.bookingid
WHERE tvh_bookings.bookingid = 1

im not joining billing via customerid since one customer can make more than one booking.... we dont need customerid in the billing table

gives access to following fields;
bookingid
customerid
eventTitle
bookingDate
bookingSlot
special
title
surname
forename
phone
email
address1
address2
address3
address4
billid
feedue
paid
0
quote
reply
Sithius
Badges: 14
Rep:
?
#56
Report 12 years ago
#56
rob, I am crap with code... can you explain what that will do? Set up a relationship between all 3?
0
quote
reply
rob.
Badges: 0
#57
Report 12 years ago
#57
your using access right, well i dont use it so im not sure :P

but yea, it connects (relationship? ) all 3 tables

its gets the info from booking table where bookingid is whatever you decide; it also gets the corresponding info from billing and customer where the bookingid matches the one in billing, and customerid matches in customer table.
0
quote
reply
Sithius
Badges: 14
Rep:
?
#58
Report 12 years ago
#58
OK, cheers Rob.

After all the advice in this thread I'm still stumped with this coursework. I don't understand what I should now that I've made the tables and (fingers crossed) corrected relationships. Queries I presume... in what way?
0
quote
reply
rob.
Badges: 0
#59
Report 12 years ago
#59
you need to create forms to add 1) a customer 2) an event

an entry should be made in billing at the same time the event is entered.

dont forget all the validation needed and 'reports' you need to be able to produce.

this coursework requires quite alot of features... read the specification :P

ps. can someone answer my original questions?
0
quote
reply
Sithius
Badges: 14
Rep:
?
#60
Report 12 years ago
#60
Well how do I go about making forms or queries? I mean I've made all this stuff before but I am still really crap and new to it at the same time...

Any links with websites would be good, I need some serious help.

My teacher explains things in a useless mannor that doesn't help atall!
0
quote
reply
X

Reply to thread

Attached files
Write a reply...
Reply
new posts
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

University open days

  • University of Lincoln
    Brayford Campus Undergraduate
    Wed, 12 Dec '18
  • Bournemouth University
    Midwifery Open Day at Portsmouth Campus Undergraduate
    Wed, 12 Dec '18
  • Buckinghamshire New University
    All undergraduate Undergraduate
    Wed, 12 Dec '18

Do you like exams?

Yes (161)
18.46%
No (530)
60.78%
Not really bothered about them (181)
20.76%

Watched Threads

View All
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise