473,545 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ComboBox Selecting Specific Records Filter

I am trying to make a workable database with Access for a reservations
program for a small hotel that I own BUT I am stuck at either a SQL command
or Visual Basic code which will tell me which rooms are free when I am
trying to make a reservation.

Let me be more specific..

I have a table which has all the reservations passed in (Fields being
RoomNo, ReservationName , ArrivalDate, DepartureDate etc).

My form is based on this table and after I enter the reservation name,
arrival date and departure date, on my form I have a combo box which pops up
with all the rooms.

I would like the combo box to show ONLY the rooms which are available and
not reserved and
that is after I have entered arrival and departure dates on my form.

Now I don't know if a query show be used or some kind of SQL command on the
Row Source property or even a Visual Basic Code.

If anyone can help it would be much appreciated.

E Mail address: an*****@hol.gr


Nov 12 '05 #1
1 1926
On Sun, 1 Feb 2004 18:23:01 +0200, Ange Kappas wrote:
I am trying to make a workable database with Access for a reservations
program for a small hotel that I own BUT I am stuck at either a SQL command
or Visual Basic code which will tell me which rooms are free when I am
trying to make a reservation.

Let me be more specific..

I have a table which has all the reservations passed in (Fields being
RoomNo, ReservationName , ArrivalDate, DepartureDate etc).

My form is based on this table and after I enter the reservation name,
arrival date and departure date, on my form I have a combo box which pops up
with all the rooms.

I would like the combo box to show ONLY the rooms which are available and
not reserved and
that is after I have entered arrival and departure dates on my form.

Now I don't know if a query show be used or some kind of SQL command on the
Row Source property or even a Visual Basic Code.

If anyone can help it would be much appreciated.

E Mail address: an*****@hol.gr


Without knowing all the fields that would be involved in your criteria, an
example of the RowSource for the combo box would be

SELECT tblName.RoomNo FROM tblName WHERE ((tblName.Reser vationName Is Null)
AND (tblName.Arriva lDate Is Null) AND (tblName.Depart ureDate Is Null));

This will bring back a list of rooms to choose from where nothing has been
entered for them. I'm also assuming that there is no other table containing
a list of valid Room numbers. Ideally, all your room numbers would be in a
table other than the one containing reservation info. The reservations
table would have the room number as a foreign key from the Rooms table.
If this is the case, the query would change slightly.
--
Mike Storr
veraccess.com
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2623
by: Pete | last post by:
I have a combobox which is used to select records, which is satisfactory at the moment. However, a second user is going to start using this database and there will be 1600 records. This makes the combobox a little unfeasable as searching through this many names would be difficult and time-consuming. I would like the user to be able to...
0
1379
by: Wolfgang Kreuzer | last post by:
Hi, I am starting to migrate an Access 2.0 application to Access 2000 (I know it's not the latest version, but ist supported in our company). I found some funny behaviours where I could not find a solution in google groups. I retrieve data from sql server (2000) and created an access project. Form is bound to a view, in the form header...
2
3157
by: Stu | last post by:
Hi, I've been working on trying to use a combo box to filter my records for a while now, and can't get it to work. Right now, I have SQL code written into IfThen statements on the afterupdate for the combobox. I tried using the docmd.runSQL but from looking at previous posts, it seems that I need to use DoCmd.OpenQuery instead since I do...
6
1773
by: Doug Bell | last post by:
Hi I have a datagrid with a combo box, I need to populate the combo with data dependant on the record value. eg for record 1, field Warehouse = 2R so combo would allow selection of locations valid for 2R record 2 has Warehouse = 2M so combo on that row has a selection of locations valid for 2M I can set the combo datasource but can't see...
1
3204
by: bcreighton | last post by:
I have created a bound subform on an unbound masterform linked together with a common field (A store's identification number) using an unbound combobox on the masterform and an invisible field on the subquery, which filters for a particular store. The subform is in continuous mode. So, what you see when you select a store is a list of all...
2
8651
by: shumaker | last post by:
I have a combobox that is very much like the one found in the RSS project here: http://msdn.microsoft.com/vstudio/express/visualCSharp/learning/ My projectNameComboBox basically is filled with a list of values from a table, and as the user selects values, a datagrid displays related records from another table because it is bound via FK...
5
5892
by: Rich | last post by:
Hello, I have a search application to search data in tables in a database (3 sql server tables). I populate 2 comboboxes with with data from each table. One combobox will contain unique CompanyID's. The second combobox will contain unique memberID's. Each of the tables that I have to search contain a CompanyID and a memberID field, and...
1
8043
by: The.Daryl.Lu | last post by:
Hi, two parts to my problem if someone can help address either one or both: 1. I want to SELECT everything in the table if it matches the criteria when the query button is pressed (this is just a commandbutton on my form). The biggest problem I'm having is that I can't (don't know how) populate a combobox on static items such as "True,...
6
3196
by: ezechiel | last post by:
hi, I have a little problem here.. when I create a form to browse trough records, everything works fine. When I'm on a certain record and say, 'manufacturer' is on 'Apple' and I do a right click "filter by selection", I browse trough the records with only 'Apple' as manufacturer. Why can't I edit the textbox to put Apple for example and...
0
7468
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7808
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7423
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7757
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5329
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4945
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.