Searching Multipal Tables
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 Replies
ADVERTISEMENT
Oct 5, 2007
Hello..
I have a query that has multipal parameters for that query. I want to be able to set it up so that the person doesn't have to use all the parameters.. IE then can use just the dates, or just the test type etc...
Here is the sql that I am currently using:
SELECT tblApplicant.ApplicantID, tblApplicant.ApplicantLName, tblApplicant.ApplicantFName, tblApplicant.LastFour, tblApplicant.TestDate, tblApplicant.JacketExpireDate, tblApplicant.Comment, tblApplicant.HomePhone, tblApplicant.CellPhone, tblApplicant.WorkPhone, tblApplicant.ContinueProcessDate, [ApplicantLName] & ", " & [ApplicantFName] AS Name, tblYsNo.YesNoType, tblLuTestType.Type
FROM tblYsNo INNER JOIN ((tblApplicant INNER JOIN tblLuTestType ON tblApplicant.TestType = tblLuTestType.TestType) INNER JOIN tblCaller ON tblApplicant.ApplicantID = tblCaller.ApplicantID) ON tblYsNo.YesNoMain = tblApplicant.Interested
WHERE (((tblApplicant.ApplicantID)=[Forms]![frmMainData]![ApplicantID]) AND ((tblApplicant.JacketExpireDate) Between [Forms]![frmReport]![txtStartInt] And [Forms]![frmReport]![txtEndInt]))
ORDER BY tblApplicant.ApplicantLName;
Thanks
View 7 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 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
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 3 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
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
Jun 25, 2007
Hi, I have two questions which i dont think are two far apart, hence same thread.
First is, how do i make a search text box, that when i click a button searches for what is in that text box, rather than bringing up the find box. It is alright but it always compares it to what was last tabbed, or is the selected tab, and i want it always to compare to another textbox called company name.
secondly. I am often entering entries to the database with the same details. but a different name, how can i have it so that i enter say 4 or 5 names which starts 4 or 5 new records, but then places the rest of the details across all the new records.
THANKS
aLEX
View 2 Replies
View Related
Jul 22, 2005
Hi All,
I have a database which has 9,00,000 zip codes.... when i am searching for a particular zip code it's taking some time.... can anyone tell me how can i speed up the process.........
CoolNax
View 2 Replies
View Related
Apr 11, 2006
Hey all.
I have a database but want to create a Search function.
I want the search function to read a drop down box for a table name, then read two text box's for search criteria then search the table and displat results.
My knowledge of Microsoft Access is limited.
I think I have the theory behind it but not the know how for the coding.
So far I have been able to get it too look at the List Box for the table name then when I hit the search button ive set it to just open the table for now.
but cant get any further, any help would be greatly appreciated.
Thanks in advance.
View 7 Replies
View Related
May 7, 2005
Hi,
I have a command button (SEARCHING). I want to Press F12 as a function key instead of pressing on the command button. Any help pls...???????
Sysop470
View 1 Replies
View Related
Jun 27, 2005
I need some assistance in searching for a recorded by employee name with the click of a button. There could be more than one record for each employee name so i need a way that once the records are found they can be displayed to the user? ANY help is greatly apprieciated!!!!
THANKS
View 6 Replies
View Related
Apr 15, 2006
I want to run a query where I can enter two dates ( On on form ) and have a report show the results.
I know I can write the dates in the criteria field in a query, but I want to be able to enter the dates on a form and do it this way.
Please help, anything will help me, I hope. :confused:
Thanks
View 2 Replies
View Related
May 10, 2005
I have built a basic database to hold details on all my computer books and software as i hundereds of them.
I have built a table with text, number and memo fields which i want to be able to search.
What i would like is a form where you can enter details into various fields (eg Title, Author, a field to search all fields, etc) and then display the results in a table in the form below it. Then when the record is double-clicked it opens the record ina new form displaying more details.
Is there a way to do it as i have spent months trying to figure it out and trying to include the sample databases?
I have attached my database so any help will be appreciated.
Thanks,
Aden
View 2 Replies
View Related
Sep 8, 2005
Hi there
In my form every time i click on the search button a box pops out and asks me if i want to continue or accpet the change. the funny thing is i just search and nothing else.
thanks
i attached a screen shot to help
View 1 Replies
View Related
May 12, 2006
Hello, I'm trying to search an entry of a recordset with VBA
The entry can only be found by searching 3 field values. In my case the correct entry can only be found if the data in the field Date, No_Employe and No_Project all match the data of the entry I want.
Findnext doesn't work, it only access one field and I need three.
Seek doesn't work since it need to search a key, and neither Date, No_Employe or No_Project are keys.
How can I proceed ?
Should I use multiples Findnext ( how do I do that ? ) ?
EDIT :
Also please note that I'm searching for 400-500 entries in a row, so speed is an issue.
View 1 Replies
View Related
Dec 11, 2006
Hi All,
I have a small yet important question to ask. I have a text box on a form, that text box accepts a product number that the user wants to modify. I want to be able to do the following:
- If the product number does not exist, prompt with an error message (this part is not a problem).
- If the product number does exist, populate the text boxes on the form with the respective data. ex: Product number 512547. Does exist, hence: (TB = textbox)
Prd. No.TB = 512547
Rec'd Date.TB = 10/10/2006
Comments.TB= blah blah blah, etc.
I am simply trying to pull information from a table into text boxes on a form using a text box.
THANKS A MILLION!
View 1 Replies
View Related
Aug 7, 2007
In my Access DB, I have a field named ‘REFNO’. This contains reference numbers of some communications. I have a Combo Box to search records with this ‘REFNO.’ It so happened that there were two communications with the same REFNO. When I typed the wanted number in the Combo Box, only one record was displayed in the form which was not the one I wanted. I was able to see the other record by opening the table. Is there a way to display the next record with the same number in the form with the Combo Box? Grateful for help.
View 1 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 1, 2005
I have a database and I made a query to search records. The query worked perfectly, but now the only problem is that if a search has an ID number that is bigger than 239, the results will not be displayed. The query will be empty! :S
What is the problem with my query?
Thanks in advance
Aber^28
View 2 Replies
View Related
Nov 11, 2005
I have to database where people enter information and some times miss entering in a field value called [Scanned Invoice] the db automatically gives every entry a date.
The first part was find out which jobs where missing a [scanned invoice] 24hrs ago by making a query [scanned invoice] Is Null [Date Entered] =date()-1 which works fine.
I then realised that sometimes people access the system on a saturday and as the system used globally and different countries have weekends on different days and theres the issues of every country having different back holidays. So i think that rules out networking days.
Is there away where i can get the query to check if the previous day had and entry and keep going back until it finds the next entry?
I tried an iif statement but i am new to Access and i could not get it to work.
I have tried iif(date()="0",date()-1) that seems to work but i can not get it to work any futher? HELP????
View 5 Replies
View Related
Feb 26, 2006
Hello Access Fans!
I've got this query whereby i would like to find the address information about people by a keyword search on either their name or their quickname which currently looks like this:
SELECT Tbl_Addresses.*
FROM Tbl_Addresses
WHERE ((((Tbl_Addresses.Name)OR(Tbl_Addresses.Quickname) ) Like "*" & [Enter a Name] & "*"));
However this doesn't return any results? it works if i search for just the Tbl_addresses.Name or the Tbl_Addresses.Quickname but not for both? does anyone know how to fix this problem?
Thank you
Jarv
View 3 Replies
View Related
Mar 20, 2006
I have a problem with an SQL query that is used to create a report, the query itself works fine, however I need to get it to do something extra. Basically we have a column that contains 1-3 letters. The letters are A, B and C. The query searches the database and returns result depending on which of the letters we entered. We do this using the like statment -:
SELECT * FROM TableUser WHERE UserType LIKE B
So the above SQL statement returns all entries with the letter B in the column UserType. Also we my need to search for AB, which returns all entries with AB and ABC. The problem is that we sometimes need to search for AC, which should return the values AC and ABC. The problem is that it only returns the values AC and not ABC. I know why it does this as it is searching for a string like 'AC', I am just not sure how to get round the problem. Is there a way of searching the string for the Value AC so that it returns the entries AC and ABC.
Thanks in advance for any help.
Cheers
Andy
View 1 Replies
View Related
Sep 9, 2006
i have put a song database together (access 2002) with a swithboard to use when i run karaoke nights.
my question is, i have a search button on the switchboard where i can search for name or artist, which works by entering the entire song name or artist but i cannot figure out how i can search for part of a field.
i know how to do it in a normal query (using the LIKE command) but it doesnt work when i try it in the switchboard
many thanks in advance
View 5 Replies
View Related