Searching Records From Various Non-linked Tables
Jan 29, 2008
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.
View Replies
ADVERTISEMENT
Jan 17, 2013
I'm new to Access2007. I created 5 tables all related to each other in series with one-to-many joins (type 2 and all enforcements on).So an Id in table 1 can show up several times in table 2, and the same is true from tables 2 to 3, 3 to 4 and 4 to 5.I want to enter new records in such way that I can see all tables at once. I tried to do that with a query, but I can only modify records, not add new ones.I have no problem adding records to individual tables but have not figured out how to do it to this All-tables query.
View 2 Replies
View Related
May 25, 2007
Hi,
I have a lot data to append to ODBC linked table in MS Access. I want to know that which way is faster to append the records.
if I append the data into ODBC linked table,
1) create the one query (append) to insert the records into ODBC linked table
2) use the VBA code (DAO/ADO) to insert the records into ODBC linked table
which way is rather faster?
View 1 Replies
View Related
Feb 2, 2012
I have a database with a number of linked tables that are linked to tables in different databases (not a back-end).for example, I have table1 that is linked to table1 in K:databasedb1.mdb.table2 linked to table2 in S:datadata.mdb.and so on...
However, recently we have moved all our databases to a new location.
K:databasedb1.mdb is now residing in O:masterdatabase
and S:datadata.mdb is now residing in O:masterdata
and so on...
I'm now in charge of relinking all those tables to point to the new location.I would do this in linked table manager one by one but we have 100s of tables linked to multiple different databases in different location.is there a way to create a VBA code that will automatically do this re-linking process?
so,
1. find unlinkable tables
2. search its new location under O:master
3. re-link it to the new location
Database names and tables names have not been changed. Just the location of databases.
View 5 Replies
View Related
Feb 23, 2005
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!
View 1 Replies
View Related
Oct 16, 2006
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..
View 1 Replies
View Related
Oct 29, 2004
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.
Any help is GREATLY appreciated...... Joe
View 1 Replies
View Related
Jun 26, 2006
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!
View 2 Replies
View Related
Dec 12, 2013
I'm developing a system which uses linked tables (to an Oracle database) and subforms. I'm trying to add functionality to create new child records, but am running into errors when saving these records.
Parent table is PATIENT, child is DIAG. I have my DIAG Form_Current event set up to detect whether a record is new. When this happens I populate the DIAG foreign key with the relevant PATIENT primary key, and run a query to the underlying database to find out the next DIAG primary key. I then populate all the necessary fields.
On attempting to leave this record however, I get an ODBC call failed error, telling me that the the primary key constraint in the database has been violated. The reason is that Access isn't saving the record to the underlying database. I've tried to prompt this using Me.Dirty and RunCommand acCmdSaveRecord, but both of these just generate type mismatch errors.
What am I missing? Is there some particular set up for linked tables and creating new sub-records that I need to put in place?
View 1 Replies
View Related
Dec 2, 2007
Lets say i have records that contain the following dates
09/06/07
14/06/07
20/06/07
31/06/07
14/07/07
And i wanted to know what records contain anything between 09/06/07 and 31/06/07 so it would show the records that have this in the date field
09/06/07
14/06/07
20/06/07
31/06/07
What would be the best way to do this
Thanks in advance
View 10 Replies
View Related
Apr 21, 2008
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?
View 1 Replies
View Related
Apr 12, 2005
Hi all,
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!
:(
View 1 Replies
View Related
Sep 5, 2004
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?
Thanks...
View 2 Replies
View Related
Mar 30, 2006
Hello All
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
Thank you guys in advance
View 1 Replies
View Related
May 2, 2014
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.
View 1 Replies
View Related
Sep 13, 2006
Hello..
I am using the following code to run a query off one table to print a report. Here is the sql statement:
SELECT tblMain.EntryNumber, tblMain.EntryDate, tblMain.EmpNumber, tblMain.DriversLicNumber, tblMain.LName, tblMain.FName, tblMain.MInitial, tblMain.Address, tblMain.StreetName, tblMain.City, tblMain.State, tblMain.ZipCode, tblMain.EmployeeStatus, tblMain.Note, tblMain.LastUpdated, [LName] & ", " & [FName] & " " & [MInitial] AS FullName, [Address] & " " & [StreetName] & ", " & [tblCities.CityName] & " " & [tblStates.StateAbbreviation] & ". " & [ZipCode] AS FullAddress, tblStatus.Status
FROM ((tblMain INNER JOIN tblStates ON tblMain.State = tblStates.ID) INNER JOIN tblCities ON tblMain.City = tblCities.CityID) INNER JOIN tblStatus ON tblMain.EmployeeStatus = tblStatus.StatusID
WHERE (((tblMain.DriversLicNumber)=[Forms]![frmPrint]![txtLicNumber]));
Here is the code I am using on the command button:
Private Sub cmdViewLic_Click()
On Error GoTo Err_cmdViewLic_Click
Dim stDocName As String
stDocName = "rptLicNum"
DoCmd.OpenReport "rptLicNum", acViewPreview
Exit_cmdViewLic_Click:
Me.txtLicNumber = Null
Exit Sub
Err_cmdViewLic_Click:
'MsgBox Err.Description
Resume Exit_cmdViewLic_Click
End Sub
Here is where I am running into the problems.
Problem #1
When I add the tables Spouses and Children to the main table in the query view I get the following erro: more then one table has LName etc.. Which is true. Is there anyway around this problem with out renaming table headers?
Problem #2
If I get problem #1 fixed how can I setup the search function I am using to look in the other two tables to pull information from them? I can get it to pull from one table how can I get it to pull information from all of my tables. I have been trying different things but nothing is working.
I don't know if it has to do with my query not working correctly when I add the other tables etc...
Thanks
R~
View 2 Replies
View Related
Jan 3, 2005
Is there a way to search multiple tables for a record. I have 4 tables, each containing a different product. In each table are lists of serial numbers (primary key) and other information (ship_to, sales_order_number,etc.) for the product. I want to be able to enter a serial number and display the information related to that serial number. Not all fields are the same for each table. Is this possible? I would greatly appreciate any help!!
View 1 Replies
View Related
Mar 4, 2007
Hi, Im new to Access and VB so please be patient with me. Do know a little about sql queries though.
I have two tables. The first (clones) has another table (BLAST Nucleotide) which is dependent on it (ie: one clone can have many BLAST records)
I want to create a search where I can search by either clone name or BLAST name, and return the results in a list box, and then select an entry from the list & view
Any help appreciated
My zip file of my database can be found HERE
View 1 Replies
View Related
Jan 25, 2008
Ok folks I have what is proving to be a doozy for me.
I have a multiple table database related fields in each one are:
Procedure
Description
Payable Amount
I am trying to find a way to search particular tables for particular Procedures. My output must include fields: Procedure, Description, Payable Amount. I have tried a form but I would have to included way too many text boxes to accompish what I am looking for. If possible I would like to have three text boxes if a form is possible. I would start the search and my output would end up in the text boxes below:
Procedure, Description, Payable Amount
With of course some sort of Identifier of the table that was selected to search in.
Can anyone help me?
Sean
View 5 Replies
View Related
Dec 6, 2004
Hi,
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
Can anyone please help ?
View 14 Replies
View Related
Jan 14, 2008
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?
View 10 Replies
View Related
Mar 19, 2014
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.
View 7 Replies
View Related
Dec 2, 2005
Ok,
I have three tables that are named different, but have the same column names, but different data in them. The data in each table is linked by a master table that has a primary key.
What I need is a way to make a form with a box where I can search on a value that could be in any of the three tables and then the associted information from the site will display in the above boxes.
(Site Master Table contains all site information and the primary key)
(The three tables are sales order information. Stage Only table, Install table, and srop ship table)
Any ideas?
View 1 Replies
View Related
Dec 22, 2011
I have around twenty shipment tables for different days and one main store check table.In the shipment tables i have bill numbers that correspond with shipping id's and in the store table i only have bill numbers.
I would like to check if the bill number in the store table appears in all 20 tables.after doing that i want the corresponding shipping ID to appear in the store table. Is this possible?
View 5 Replies
View Related
Jul 30, 2012
I have a database in which the year is stored in a table called year with as laid out below
"YearID" autonumber field and the
"Year" field which is a date field.
I am trying to search for records via a query for just the current year, i.e. the highest autonumber and I am having no success.
View 4 Replies
View Related
Jan 22, 2007
Hi. Please do not lecture me on database normalization, as this truly is not in my control.
I have 2 dozen tables, each with 13 fields. All of the field names exist in at least 12 of the tables. And all tables share a ssn field where values are common.(Confused yet? Sorry, if you are...)
If I design a query showing all 2 dozen tables and their fields...
Can I set up a query criteria where I enter the requested ssn and then the required field name and have the result show the values of all the fields with that name, among the ones of the 2 dozen tables where that field name exists? (for that specified ssn)
If I am only as clear as mud, please let me know, and I will try again.
Or, by asking if I can search for field values querying by field name, am I any clearer?
Russ
View 14 Replies
View Related