473,769 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reservation System Using Microsoft Access

14 New Member
Hi everyone,

I wonder who can help me on the filter the Start Date and End Date. I still cannot manage to filter it.

Eg. When the user click the StartDate(combo Box as 16/7/07), the Start Date(textbox should show only 16/7/07) and this also apply to the EndDate.

Private Sub cboStartDate_Cl ick()

'Purpose: Build up the criteria string form the non-blank search boxes, and apply to the form's Filter.
'Notes: 1. We tack " AND " on the end of each condition so you can easily add more search boxes; _
we remove the trailing " AND " at the end.
' 2. The date range works like this: _
Both dates = only dates between (both inclusive. _
Start date only = all dates from this one onwards; _
End date only = all dates up to (and including this one).
Dim strWhere As String 'The criteria string.
Dim lngLen As Long 'Length of the criteria string to append to.
Const conJetDate = "\#mm\/dd\/yyyy\#" 'The format expected for dates in a JET query string.

'************** *************** *************** ***** *************** *******
'Look at each search box, and build up the criteria string from the non-blank ones.
'************** *************** *************** ***** *************** *******
'Text field example. Use quotes around the value in the string.

If Not IsNull(Me.cboSt artDate) Then
strWhere = strWhere & "(([StartDate] = '" & Me.cboStartDate & "')) OR "
End If


'************** *************** *************** ***** *************** ******
'Chop off the trailing " AND ", and use the string as the form's Filter.
'************** *************** *************** ***** *************** *******
'See if the string has more than 5 characters (a trailng " AND ") to remove.
lngLen = Len(strWhere) - 4
If lngLen <= 0 Then 'Nah: there was nothing in the string.

MsgBox "No criteria", vbInformation, "Nothing to do."

Else 'Yep: there is something there, so remove the " Or " at the end.
strWhere = Left$(strWhere, lngLen)
'For debugging, remove the leading quote on the next line. Prints to Immediate Window (Ctrl+G).
Debug.Print strWhere

'Finally, apply the string as the form's Filter.
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub

Private Sub cboEndDate_Clic k()

'Purpose: Build up the criteria string form the non-blank search boxes, and apply to the form's Filter.
'Notes: 1. We tack " AND " on the end of each condition so you can easily add more search boxes; _
we remove the trailing " AND " at the end.
' 2. The date range works like this: _
Both dates = only dates between (both inclusive. _
Start date only = all dates from this one onwards; _
End date only = all dates up to (and including this one).
Dim strWhere As String 'The criteria string.
Dim lngLen As Long 'Length of the criteria string to append to.
Const conJetDate = "\#mm\/dd\/yyyy\#" 'The format expected for dates in a JET query string.

'************** *************** *************** ***** *************** *******
'Look at each search box, and build up the criteria string from the non-blank ones.
'************** *************** *************** ***** *************** *******
'Text field example. Use quotes around the value in the string.

If Not IsNull(Me.cboEn dDate) Then
strWhere = strWhere & "(([EndDate] = '" & Me.cboEndDate & "')) OR "
End If


'************** *************** *************** ***** *************** ******
'Chop off the trailing " AND ", and use the string as the form's Filter.
'************** *************** *************** ***** *************** *******
'See if the string has more than 5 characters (a trailng " AND ") to remove.
lngLen = Len(strWhere) - 4
If lngLen <= 0 Then 'Nah: there was nothing in the string.

MsgBox "No criteria", vbInformation, "Nothing to do."

Else 'Yep: there is something there, so remove the " AND " at the end.
strWhere = Left$(strWhere, lngLen)
'For debugging, remove the leading quote on the next line. Prints to Immediate Window (Ctrl+G).
Debug.Print strWhere

'Finally, apply the string as the form's Filter.
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub
Jun 14 '07
23 7135
nairda
39 New Member
Hi Nairda, I figure the previous problem. Thank anyway.

Do you know how to close the table by writing codes?

By the way, I am wondering how to show in the calendar that can classified which equipment is book or not?

Great then!

What table do you want to close? Your database table or datagrid table?

Sorry Steve, I don't know how to show booked equpment in the calendar. Perhaps you could post a new thread regarding this problem.

Thank you.
Nairda
Jun 20 '07 #21
Steven TK
14 New Member
Great then!

What table do you want to close? Your database table or datagrid table?

Sorry Steve, I don't know how to show booked equpment in the calendar. Perhaps you could post a new thread regarding this problem.

Thank you.
Nairda
Hi Nairda,

Do you know the search criteria database provided by allen brown? Can you eliminate the last line of the textbox because there is not information record there?
Jun 21 '07 #22
Steven TK
14 New Member
Hi Nairda,

Do you know the search criteria database provided by allen brown? Can you eliminate the last line of the textbox because there is not information record there?
Hi Nairda, Do you how to transfer the data from 1 comboBox in the form to another comboBox in another form?

Another Question,

I got several comboBox list for the user to select but i want to save the record after the user fulfill some criteria. It is just like I don't want the comboBox list to be bound first but after the user has fulfill the criteria , they just simply press the save record button and save the record into the table.
Jun 29 '07 #23
Steven TK
14 New Member
Hi everyone,

Q1.
My Msgbox show this
"Please confirm the record again"
EmployeeName : 3 (still got the ID Number not the Name)
ToolName : 3 (still got the ID Number not the Name)
StartDate : 7/6/2007
EndDate : 7/6/2007

Can I not show the ID Number but instead the TOOL NAME and EMPLOYEE NAME?

Q2.

For Eg1, the user select Digital Multimeter, Start Date is 17/7/07 and End Date is 19/7/07, However, this record is already been recorded in the table, it should not be allowing to record this data. It works well on Eg1 by preventing the dulipcate record. However, it prompt the run time error. For Eg2, the user select Digital Multimeter, Start Date is 18/7/07 and End Date is 18/7/07, this record also must not be save in the data. It does not work as the criteria stated in Eg2 and the date is in between the 17 July and 19 July.


I started create the brand new table with the ToolID , StartDate and EndDate as a primary key. It indeed does not save the record , however, it still prompt me the run-time error 3022 "The changes you requested to the table were not successful because they would duplicate value in index, primary key or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entry and try again".

I suspect the error is the coding

Set db = CurrentDb
Set rst = db.OpenRecordse t("ReservationT able")
With rst
.AddNew
!EmployeeID = Me.cboEmployeeN ame
!ToolID = Me.cboToolName
!StartDate = Me.txtFromDate
!EndDate = Me.txtToDate
!Status = Me.txtStatus
!UserName = Me.txtApplicati onUserName
!CPUName = Me.txtCPUName
!DateRecord = Now()
.Update
End With
rst.Close

But I don't know how to stop this error.. Need help..
Jul 10 '07 #24

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2131
by: John Bevilaqua | last post by:
We have developed a prototype working application to handle Reservations or Appointments into an Access 2002 or SQL Server 2000 backend system. These Reservations can be originated using an Interactive Voice Response System (IVR), a Web enabled form, and in the 4th Quarter of 2003, a Palm Pilot interface, too. They all feed into the same backend database in real-time offering considerable savings in determining the exact
11
5230
by: Robert | last post by:
Would you use Access to create a car rental reservation system? I would think that the complexity of such a system would be better suited to a procedural language like Visual Basic or C++. Your thoughts, please. Robert
5
4809
by: KarlM | last post by:
Is there any sample code for making a DHCP reservation via C#? Thanks in advance
4
6087
by: johnny.shz | last post by:
Hi, does anyone know a php5 based web calendar and reservation system? I'm looking for the following features: 1. two types of users: a calendar owner, and guests 2. guests can see what slots are free or reserved, can make a reservation, cancel a reservation 3. owner can confirm a reservation Thanks.
1
4883
by: hiboo | last post by:
Does anyone know of any open source java software/code libraries for doing travel/airline reservations? I'm looking for a typical airline (hotel, car rental?) reservation system. system in perl or c, c++ ok.
1
3420
by: tabloidster | last post by:
Howdy All, I recall seeing a similar post a while back, but I'm not an expert VB programmer so I'm still not clear... For my VB6 class, I've got to code a basic reservation system. Let's say that the plane has 6 passenger seats total via 2 columns (A and B for arguements sake) and 3 rows per column. An array here, right? We have to display a seating chart, which I could probably setup with labels and set the caption property with green...
11
5200
by: jimmy | last post by:
I'm in the process of developing a reservation management system for small restaurants. I am stuck on creating an algorigthm for managing the reservations. For example i need to check that a table is avaialbe and when etc. I understand that i'll need a database table containing information about the tables in the restaurant but further than this im pretty clueless so any help would be much appreciated.
0
2791
by: =?iso-8859-1?Q?Leentje=AE?= | last post by:
Hi, i'm surching a een asp-script "room reservation" i've searched with google, without succes the good scripts are to be payed but i'm looking for a free script example: the room-reservation-system from digirez http://www.digiappz.com/digirez.asp?id=1 is magnificent (demo : http://www.digiappz.com/room/index.asp )
2
7572
by: cotty | last post by:
AIRLINE RESERVATION SYSTEM A small airline has just purchased a computer for its new automated reservations system. The president has asked you to program the new system in C. You are to write a program to assign seats on each flight of the airline’s only plane (capacity: 20 seats). Your program should display the following menu alternatives: Please type 1 for “business” Please type 2 for “economy” If the person types 1, then your...
0
2261
by: jrhitokiri | last post by:
QUESTION 1: I'm trying to create a room reservation system for school using wicket and MySQL, and I'm a bit confused with this one. I've already created the user database and rooms database. My question is how do I create a schema that accepts both repeating and non-repeating schedules? example (repeating): I can reserve a room for class at 9:00am - 12:00pm every Monday and Thursday, from June - October of 2009. How do I represent this in...
0
9589
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6675
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.