473,473 Members | 2,025 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

create a query!

4 New Member
Hi

I am very new at all of this, so please help. I have written a database that books out equipment on a daily bases. What I am struggling with is, I have created a query that shows me the equipment I have booked out, but although I can see it, it must not allow me to double book it. I have absolutely no idea on how to do this.

Please can anyone give me some tips on how I can solve this.

Thanks
Aug 17 '07 #1
6 1238
Stwange
126 Recognized Expert New Member
Hi

I am very new at all of this, so please help. I have written a database that books out equipment on a daily bases. What I am struggling with is, I have created a query that shows me the equipment I have booked out, but although I can see it, it must not allow me to double book it. I have absolutely no idea on how to do this.

Please can anyone give me some tips on how I can solve this.

Thanks
How do you book it out? Using a combobox? Textbox? What field is set if equipment is booked out? I need more information.

Thanks.
Aug 17 '07 #2
Matthew38
4 New Member
How do you book it out? Using a combobox? Textbox? What field is set if equipment is booked out? I need more information.

Thanks.
Hi

I use a combobox with a drop down menue with "In" and "OUT" as the the field. I am not sure if I did the correct way.

What happens is that on a daily bases I have to book In and Out equipment. There is a lot of it. What also happens is that equipment will booked out and then brought back a few minutes later and if I don't book it back because it is so busy I make the mistake of booking it out again. This I lose track of the in and out. That's why I need it to show me it is booked out by maybe a field color change and by not allowing me not to book it out again until it is booked in.

I hope this makes sense.

Thanks
Aug 20 '07 #3
Stwange
126 Recognized Expert New Member
One way would be to have a command button for booking it out, and ensuring the combobox has the not in list property set to false.
Now, assuming you have some field ID to identify the equipment, and this is stored in txtID, and your command button is cmdBookOut (so obviously, modify the code as necessary):
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdBookOut_Click()
  2. dim rs as DAO.recordSet
  3. Set rs = DBEngine(0)(0).openRecordSet("SELECT * FROM Equipment WHERE ID = '" & txtID.value & "';")
  4. if rs!booked = "OUT" then
  5. msgbox "That equipment is already booked out.",vbcritical,"Equipment unavailable"
  6. else
  7. docmd.runsql("UPDATE Equipment SET booked = 'OUT' WHERE ID = '" & txtID.value & "';")
  8. msgbox "Equipment successfully booked.",vbinformation,"Database Updated"
  9. end if
  10. End Sub
  11.  
Let me know if you have any problems with this.
Aug 20 '07 #4
Matthew38
4 New Member
Hi
Thanks for the quick response. Please, Like I said, I am very new at this. The form runs of a query. Now I am not sure if you can still do what you have suggested.
If I where to put in a cmdbox, where will I put it and The "not in list" properties, How do I set the property to False. Do I type it in?

Form: Runs of a query

JobNumber
WorkerName = Combobox = Table Employee
Location = Combobox = Table Location
Equipment = Combobox = Table Equipment
InOut = Combobox = Table In/Out
Date

Please help!!
Thanks
Aug 20 '07 #5
Stwange
126 Recognized Expert New Member
Hi
Thanks for the quick response. Please, Like I said, I am very new at this. The form runs of a query. Now I am not sure if you can still do what you have suggested.
If I where to put in a cmdbox, where will I put it and The "not in list" properties, How do I set the property to False. Do I type it in?

Form: Runs of a query

JobNumber
WorkerName = Combobox = Table Employee
Location = Combobox = Table Location
Equipment = Combobox = Table Equipment
InOut = Combobox = Table In/Out
Date

Please help!!
Thanks
Just so I don't write irrelevant code for you again (although it is slightly relevant...), please can you paste me the rowsource of each of those comboboxes (you can find this by right clicking on them in design view -> properties -> row source (the "not in list" property is here also, and you just click and select no - not completely necessary, but will help prevent user error). I also want to see the design of Table Equipment and Table In/Out (just the relevant fields will do - primary key, foreign keys, and any fields you might want the code to update).
These few bits of information should give me enough information to provide you with a full answer. It would also be helpful (but not strictly necessary) if you could take a screenshot of this form (press Print Screen), and then paste this into paint, label any controls (doesn't have to look good, just a rough indication), and upload it somewhere or attach it.

Thanks, and sorry for asking for so much.
Aug 20 '07 #6
Matthew38
4 New Member
Hi
Thanks so much for wanting to help. Is there no way I can send you the database. It is only 2.37megs big. My email address is matthew@dnkfire.co.za. Pleae let me know. If not I will try and do as you asked.

Thanks again
Aug 21 '07 #7

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

Similar topics

5
by: lkrubner | last post by:
I have a webserver through Rackspace. I create a domain. I create an FTP user. I upload some files. I create a database called testOfSetupScript and then I create a database user named setup. I...
8
by: Donna Sabol | last post by:
First, I should start by saying I am creating a database to be used by some very impatient, non-computer literate people. It needs to be seameless in it's operation from their point of view. I...
6
by: sheree | last post by:
I would like to create a query where one of the columns of the queries comes from a combo list box on a form. For example, if my table has the following fields: id name interest1 interest2...
4
by: Apple | last post by:
1. I want to create an autonumber, my requirement is : 2005/0001 (Year/autonumber), which year & autonumber no. both can auto run. 2. I had create a query by making relation to a table & query,...
18
by: PC Datasheet | last post by:
An Access user saw my name in a newsgroup and sent me a request for help on a project. As part of the project, a list of the dates in a month was needed. For anyone needing a list of dates in a...
13
by: forbes | last post by:
Hi, I have a user that used the Query Wizard to create a query in Access. Now she claims that her master table is missing all the data that was excluded from the query. Can you create anything...
2
by: angie | last post by:
I need to figure out how to create a user interface to search a query, but here's the bad part...I need to account for criteria on at least 7 of the fields. Here's what I'm thinking I need to do:...
8
by: chrisdavis | last post by:
I'm trying to filter by query or put those values in a distinct query in a where clause in some sort of list that it goes through but NOT at the same time. Example: ROW1 ROW2 ROW3 ROW4 ,...
15
by: harvey | last post by:
How do I make PHP create a database for mysql please? I can see how to make tables and I have read all the documents I can find but I don't understand how to make the database itself. All...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
0
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,...
0
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...
1
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...
0
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...
0
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,...
1
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...
0
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...
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.