Combo Data Display

davidnash

RAF DBA Man
Local time
Today, 12:56
Joined
Jan 25, 2006
Messages
14
I am fairly new to VBA, having done no fromal training. I have taught myself quite alot and I am pleased with how i am progressing. I am stuck though!

I am building a booking system for a friends business, all free of charge as I believe it's a good project to get experience in VBA.

The booking form has a 'Date' Combo box, 'Name' Combo box and a 'Time' Combo box. The 'Time' Combo box displays times in 10min intervals from 0600 to 2100, and this data is stored in a table called 'tblTimes'. I need to build a query that checks the main table 'tblBooking', for a selected date chosen in the 'Date' Combo box by the user, to see what times have been used up and thus only display, in the 'Time' Combo box, those times not yet used for that particular datedate.

I am sure, to some of you experts out there, that this is quite a simple query. I looki forward to your input.
 
Try the following query changing the names to suit your DB

SELECT tblTimes.times, tblBooking.BookDate
FROM tblTimes LEFT JOIN tblBooking ON tblTimes.times = tblBooking.BookTime
WHERE (((tblBooking.BookTime) Is Null) AND ((tblBooking.BookDate)=[Forms]![frmBookings]![ComboDate]));

Hope this helps.
 
It's Not Woking For Me

Thanks for your help. It's not working for me. I have attached the database. The query is qryTimeChecking. If you look at the form you will see what I am trying to do. For a particular date, I don't want to show a time that's already been allocated to a booking.

I'll be a happy man if you can fix this for me.
 

Attachments

Hi,

Just got back from work and seen it didn't work for you, I should have been a bit more specific, have fixed the prob for you, hope this is what you want.

Good luck and let me know if it is not right.

Sean.
 
Last edited:
It Didn't Work For Me

It may be because I have developed in Access 97 and the code you may have entered isn't working for me.

When I opened it some dates had been removed from the list, I got excited, but then I entered a new booking, saved it and then enetered another on the same date; the time previously selected was still visible. On checking the tblBooking, TeeOffTimeID was set to zero for the two entries.

I will take it home with me and try it in Access XP. What do you think?

I believe I am the problem.

If this doesn't work I may try it with PHP & MySQL.
 
Sorry about that, missed one step setting the teeoff time to equal what is selected in the combo box before saving your record. Have tried it and it seems to be working fine now.

View attachment GolfBookingfix.zip
 
Last edited:
Thanks Very Much!

It appears to be working. I can see how it's been done. I have finally got a VBA course sorted for the end of the month at QA IT Training in London. Hopefully, one day I will be as good as yourself.

Cheers
Dave
 

Users who are viewing this thread

Back
Top Bottom