I am currently building a booking and invoicing database for the small business where I work. One aspect of this database allows you to enter an employee name and schedule days off via a form I have already built. To access this information I would like a parameter query where you can enter a date once and then have this date looked up across a number of date fields. Here are my table column headings:
ID Employee Name Date 1 Date 2 Date 3 Date 4 Date 5 Date 6 Date 7 ....etc
So, basically, the parameter query would ask "What date?" which the person would enter, and then search all 12 date fields to see if the date was contained in any one of them. Then it would pull any records which did have the date in one of the fields.
It seems really simple but I have searched and searched and can't seem to find the answer. Tried a multivalue field but does not seem to work.
Thanks very much, any help appreciated! Elspeth :confused:
I have a date base where i am looking for all records which are not scanned every time an order is entered a date is generated. I then want to find all the ones which have not scanned for today. (i know i can do this by a query i.e [Date] =date() .)
Now the problem is that if nothing is entered in today for example i then want to find the next day something was entered.
I am a novice with access and i think there must be some coding which i need to create in a module prehaps but i am unsure. Could any one assist??
I have a parent table called patient info. and a child table called fills. The database in the future will become very large, and will be difficult to find a particular patient in the parent table to update fills in the child table. How can I search through the parent table with ease so that I can update fills? Thanks for those who help!
hi.. i am currently creating an employee database.. and there is a form on the database that needs to search on records.. i am planning to create a form with a single textbox (for the keyword entry) and a search command button that when clicked, the search results will be shown in a seaparate continuous form.
now here is my query:
SELECT tblEmployee.EmployeeIDPK, tblEmployee.LastName, tblEmployee.FirstName, tblEmployee.MiddleName, tblCompany.CompanyName, tblDealer.DealerName, tblOutlet.OutletName, tblPosition.PositionName FROM (tblOutlet INNER JOIN (tblDealer INNER JOIN (tblCompany INNER JOIN tblPosition ON tblCompany.CompanyIDPK = tblPosition.CompanyIDFK) ON tblDealer. DealerIDPK = tblPosition.DealerIDFK) ON tblOutlet.OutletIDPK = tblPosition. OutletIDFK) INNER JOIN tblEmployee ON tblPosition.PositionIDPK = tblEmployee. PositionIDFK WHERE (((tblPosition.PositionName)=[Forms]![frmSearchEmployee]![txtSearchFor]) ) OR (((tblOutlet.OutletName)=[Forms]![frmSearchEmployee]![txtSearchFor])) OR (((tblDealer.DealerName)=[Forms]![frmSearchEmployee]![txtSearchFor])) OR (( (tblCompany.CompanyName)=[Forms]![frmSearchEmployee]![txtSearchFor])) OR (( (tblEmployee.MiddleName)=[Forms]![frmSearchEmployee]![txtSearchFor])) OR (( (tblEmployee.FirstName)=[Forms]![frmSearchEmployee]![txtSearchFor])) OR (( (tblEmployee.LastName)=[Forms]![frmSearchEmployee]![txtSearchFor])) OR (( (tblEmployee.EmployeeIDPK)=[Forms]![frmSearchEmployee]![txtSearchFor]));
but when i click search, the results are empty. what could be wrong with the query? is it the query? what should be the record source for the search form and the result form?
if you want to see the actual ms access file, here it is: http://www.gigafiles.co.uk/files/636/human%20resource%20info%20system_2006-10-11.zip
the name of the form is frmSearchEmployee and frmSearchResultEmployee and the name of the query is qrySearchResult.. thanks a lot and God bless..
I would like to put a search tool on a form that does pretty much the same as the find dialogue box, with out it being a dialogue box...
I need to be able to search specific fields on the form and all the fields. It needs to "Find Next" so to speak, as in not just finding the first match.
I wanted to see if it is possible to pull a query by just entering say the first three letters of a project name and the query displaying everything from the table that begins with those three letters. Any help with this is greatly appreciated. I am just completely stuck!
I have a form I am using to search for records based on any number of criteria. The one I am having a problem with is a model number search. I would like to search based on a from value and a to value.......for instance........let's say you had the following items:
bird birth bill birdbath bite bitter
If I want to search for values from bir to birt, I would get bird, birdbath and birth. How can I code my query value to look for values between two text boxes in a form?
With some help from this forum (esp. Pat Hartman), i've been able to code up a script that performs a check on duplicate values.
My database has a Room Bookings form which consists of the room name, periods and booking date (BDate) fields. I need to prevent a duplicate on the same date, period and room.
The only problem with my code is that it only does a check on one of the fields e.g. BDate although i select a different period or room it still comes up with an error message saying that booking already exists? This means it is only checking the duplicate value of 1 field and not a combination of fields.
Here is my code:
Private Sub Form_BeforeUpdate(Cancel As Integer) Dim strSearch As String Dim varKey As Variant
strSearch = "BDate = #" & Me.BDate & "# And Period1 = """ & Me.Period1 & """And Period2 = """ & Me.Period2 & """And Period3 = """ & Me.Period3 & """And Period4 = """ & Me.Period4 & """And Period5 = """ & Me.Period5 & """And Period6 = """ & Me.Period6 & """And Lunch = """ & Me.Lunch & """And After_School = """ & Me.After_School & """" varKey = DLookup("Booking_ID", "Furtherbookings", strSearch) If Not IsNull(varKey) Then If MsgBox("Booking already exists Booking ID: " & varKey & ". Do you wish to continue to create a new record?", vbYesNoCancel) = vbYes Then Else Cancel = True Me.Undo End If End If
End Sub
Can any1 identify where i am going wrong?
I'd really appreciate any help/guidance to resolve this problem!
I'm trying to write an app that will allow the user to search for records based on database fields, then select a subset of those records to be manipulated by other functions. The VBA book I'm reading led me to believe that a RecordSet would be the best way to store this subset of records, but searching around on the web has pointed me toward using a DAO.QueryDef. I can't seem to get either method to work!
Here's a quick overview of the app: everything is placed on one form. I have two tab controls that make a sort of upper and lower set of pages. One of the lower pages has the search functions. The user enters his search criteria into one or more textboxes (correlating to database fields, i.e. Last Name, SSN, etc), then hits the Search button. This should query the database, then populate a listbox with the search results. The user can then select one or more records from the listbox, hit another button, and the selected records are copied to another listbox on a page on the upper half of the form, where they can be further manipulated.
Can someone advise me on the best objects to use to accomplish this? A short code sample would be awesome.
By the way, does VBA have some sort of online API reference (like Java)? I know that MS Access has the object browser, but it doesn't give descriptions of the objects, nor does it list methods that can be invoked on them. Could someone also point me towards some good programmer's resources?
I have a table called tblorders for orders. So I have a form for this, frmOrders.
I also have a form to perform various searches on the orders. So I have a date textbox on this search form and a command button which I want to open the frmOrders according to the date I enter in the textbox. But even though the date on the search form matches the date in tblorders it does open the relevant record??!!
The date textbox is linked to the date field in the tblorders but it doesn't recognise it even if the date is correct! Everything is set to Format: Short date
Any ideas? This system works for other things like serial number etc but not the date for some reason.
I have a table that has 4 fields; id_vl, id_product, date_vl, vl.
Basically each product is valued either on a monthly, weekly or daily basis. I want to create a filter that is based on a text box that filters the dates from which one can look at the dates of valuation and the associated values.
The problem comes with the products valued on a weekly or monthly basis. For example, if I simply say [tblvl].[date_vl]>=Me.textbox, and me.textbox = 13/09/2013, yet the last value date for a weekly product was 09/09/2013, this record won't be included. Therefore I need to set the date of the previous record as the filter. This is my attempt but it doesnt work...
FROM tblVL WHERE iif(tblvl.date_vl<>me.fees_start_date, [tblVL].Date_VL>=(SELECT MAX(PrevDate.Date_VL) FROM tblVL AS PrevDate WHERE PrevDate.Date_VL<[tblVL].[Date_VL] AND PrevDate.Id_Product=tblVL.Id_Product;),tblvl.date_vl>=Me.fees_start_date) ;
I've been looking and abusing the search function on this forum for this particular obstacle but no luck.
The client im building a database for wants a search form and everyone who used the old system are used by using *'s in their search criteria. I know how I can use *'s in queries but its fixed (I think). I want to let the end user use * when they want to pin down a particular product. So they just type in a part of a word and use a * at the end, middle or before.
Or should I just abandon the idea of using them in input form controls? I know this works because I have seen it before, too bad I had no access to the source of it.
I hope someone comes up with some ideas, pointers or howto's
Hi all, I've got one question again. Let's say. I've created several tables to store data for several categories.Note: there is no relationship between each table.In each table, there is the date field in which the record is created. Then I want to make another daily record form that is to find records from all categories which is created at the current date. Is this possible to search records from various tables and combine them to show in one form or report? Can anyone help me in this case? thanks in advance.
I have a database which has numbers for different statistics and i would like to be able to search, for example, the past 10 weeks and find out how many time a certain number has been recorded.
I've been banging my head of a brick wall with this one. Its probably straight forward... but I can't see the solution! A problem shared is a problem halved... or so they say!
Ok I have this table called CustomerComments. In it are the following columns
CustID Comment CommentDate
For each custID I want the most recent commentdate and its matching comment from that row... (there can be multilple comments recorded per custID)
Problem is I can't seem to get this to work.. instead its returning all rows. I have run a query that will sort and group this list. The top line of the grouping gives the most recent comment and commentdate per customer.
Does anyone know how I could just get that top line per custID rather than all rows returned?
The database is a patient database used for tracking Inpatient data and Handover (or Handoffs for those in the US). It has been merrily ticking over since December and has accrued several thousand records. To get access to this data in new and interesting ways Im trying evolve my rudimentary search function which currently only works for diagnosis, name and consultant (in otherword text fields).
Thus I have an unbound form that has various input boxes on it. I have borrowed some code to power the form and have replaced with own fields:
Code:
Dim criteria As String
Looks for input text and adds it to the final criteria to power the search list at the end based on field in this case txtDiagnosis
If Not IsNull(Me.txtDiagnosis) Then
If criteria <> "" Then criteria criteria & " and " criteria = criteria & "txtDiagnosis like " & Chr(34) & "*" & Me.txtDiagnosis & "*" & Chr(34) End If
[code]...
ISSUE 1: I am struggling with the date search function. It doesn't work. Whether it is prudent to search for either a admitted date or a discharged date?
ISSUE 2: I have a check box for "complications" that I'd like to be included on in the search.
i'm trying to filter is a datetime value and it just doesn't whant to work.I tried to make a separate unbound text field to filter out the Datetime into year and then filter that field out with year but it doesn't work. What I did:
-I clicked on the control element of the unbound text field. -made a expression with this code : datepart ("YYYY", [BeginDatetime]) -(BeginDateTime is a table value) -After this one it keeps showing me this error : -"the syntax of the expression You've taken specified is invalid"
I am currently working through my A2 (final year of high school in the UK) ICT coursework, in which I am building an Access database system for a small wedding car hire company.
My current problem is I would like to (not even sure if it's possible but I assume it is) have a form that searches a query for a date that the customer has entered.
If there is no date in the query that matches the one that the customer has entered, it means that their chosen date is available. If there is a match however it means that the date is unavailable.
I have a form that runs a parameter query to search for university name and then displays 2 fields, university name and course name.
I am having difficulty with a search button that i have on the form called search_command; it is supposed to run the exact query as when you enter the form, it does this but displays the result in a dataheet, i want it to repopulate my 2 text label fields as mentioned above.
In addition i want then to be able to go to a specific record, select it and then press a button to append it to another table. i ahve not started this part yet
i am a beginner.. how i can write a code in a afunction that search a record in a table according to some conditions example: i hv table employee that contains Title field which can have one of 3 values:Admin, Rep or Driver i need to search the employee that has his type = admin i can have one or more records that have this type... so how to find first one, last one and all?
I have a database that I am creating for my work. I have a form that I am trying to get it to search the information from a table to pull the record on the form. I would like to search infomation such as employee id and wanting it to pull that information from the table.
I'm trying to search for a variable (varCod) in a table(SerialNumberCustomer) but I want to only store the returned variable in an array if its shipDate is between 9/30/2001 and 10/1/2012
this is what my code looks like so far:
Set rst = CurrentDb.OpenRecordset( _ "Select * from SerialNumberCustomer WHERE SerialCardId = " & varCod & " AND (ShipDate BETWEEN #09/30/2001# AND #10/01/2012#) ")
The line of code works and it returns all of the values in SerialCardId where it's = to varCode but it doesn't go through with the shipDate requirement. It's instead returning all of the dates with the found value.
I have a table that has entries recorded with date and time in one field, and I want to have a query that returns all records of a specified date or date range, regardless of the time in the field.
I have tried
Code: Between [StartDate:] And [EndDate:]
And
Code: Between [StartDate:] & "00:00" And [EndDate:] & "23:59"