Searching Database Based On 3 Columns
Aug 23, 2011
I have a requirement of searching the database based on 3 columns. I have attached the search form and the code.
Private Sub cmdSearch_Click()
Dim strSQLHead As String
Dim strSQLWhere As String
Dim strSQLOrderBy As String
Dim strSQL As String
Dim strJoin As String
[Code] .....
View Replies
ADVERTISEMENT
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
Apr 17, 2014
I have a combo box with 2 columns, Item # and the Item Description. As of right now I have to type the Item # and it will autofill the text. I was wondering if there is a way if I don't have the Item # that I can search/type the description in the combo box field and it will autofill?
View 2 Replies
View Related
Feb 5, 2005
How can I get a PK in another table, based on searching for it based on 2 values. By searching with 2 values you will always get only 1 record.
READ BELOW FOR SITUATION
My Problem on my form:
The user enters 2 values, after entering the 2nd value a Unbound combo box runs a query, which searches for these 2 values (unique), that appear in a separate table.
These 2 values are unique toegether, but records in this separate table have another field, its Primary Key (AutoNumber), used to identfy the pair.
So back to this Unbound Combo Box that searched for the primary key of the 2 values entered. Now Only the Primary key can be selected from the combo, the value that I'm after.
But since there will only be 1 option (being unique), how can I have the PK value aready stored in an Unbound text box, as opposed to having options in a Combo box?
View 5 Replies
View Related
Dec 16, 2006
Hi,
I have a form that is based on a query with many fields. As an example there is a field called "Medium" which contains values such as "Oil on canvas", "Oil on wood" etc.
At the moment I have a filter which works fine but this doesn't allow me to search all records which have the word "Oil" as part of the Medium.
I would like to be able to search all fields on the form. I have looked at a few exmaples on the forums but could not find one that applies to my scenario.
Can anyone help?
Thanks in advance.
View 4 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
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
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
May 27, 2005
hi
does anybody done this project that posted below in little more advanced mode ?!
http://www.access-programmers.co.uk/forums/showthread.php?t=79612
View 1 Replies
View Related
Sep 27, 2004
I have a small search page that is very precise. ie. it returns the first record that is the same.
Is there anyway I can make a search form that is a bit fuzzy. ie if i had a field dedicated to the make of a vehicle can I filter it out for that make of vehicle. I've been using a filter, but it all seems rather messie.
Help
Regards
Asperation
PS, on the upside if there is anyone that needs help making a precise search page im happy to paste the code.
View 6 Replies
View Related
Oct 9, 2012
my database lag whenever i start searching, not really bad but i could notice that it blinks whenever i press a key on my keyboard. computer has a big ram (4gb), i5, with 500gb HDD... lots of free space. the database file is only 6.9MB..maybe there is a code that disable or makes the blinking unnoticed?
View 3 Replies
View Related
Apr 12, 2012
I was wondering if there is a program that allows you to do a search of your database.
For example, if i wanted to find out where im using certain queries, is there a way to do a "ctrl+F" for access ?
View 2 Replies
View Related
Mar 13, 2008
Hi there,
I am designing a search tool for a database table which has attributes such as part number, manufacturer's part number, description, etc. Each item in the database has all these attributes associated with it.
When I search, I am trying to allow a popup to occur when I want to access a modified report that has my search results computed. I created a query and a report, added some SQL code to it, etc. I can basically click the report and have my inquiry window come up asking for the part number, but I'm not sure if it's associated with my database because when I put in the #, the report comes up blank.
I right-clicked my Report and look under "Objects that I depend on" and my Queries tree is full of dependencies that point me to my database table. There is, however, still no report with any substance that I can pull up no matter what part # I put in.
Does anyone know what's going on? I know this is really easy and it's driving me crazy cause I've never used Access before. I don't necessarily have time for tutorials and any lesson enrollment since it's for work, and my profession has absolutely nothing to do with this. Ha.
Thanks for any help you may be able to offer.
Richard
View 5 Replies
View Related
Jun 13, 2013
I have a database and would like to search history of some fields but they are autonumber and it won't let me search them.
The fields in question are on the form Workorder:
WorkorderID
CustomerID
View 10 Replies
View Related
Apr 4, 2014
I already have many table for each month , JanuaryT-DisemberT. I'm using simple form to key in data inside that table. Inside to that table (JanuaryT-DisemberT) have project number data i want to notice pop up when i try key in if that project number not valid..
example
JanuariT
Name -Project Cod- Validation
John -2012ABC - Not valid
Michel-2013WER-Valid
Mike-2014TERG-Valid
FebruariT
Name -Project Cod- Validation
Ann -2011AAA - Not valid
Sam-2012BCB-Valid
Tony-2013TEC-Valid
What i want to do is when i want to key in data in MacT using Form with ADD butoon, some notice will come out if .... for example : Daniel-2011AAA or Jony-2012ABC the notice will come out " THIS PROJECT COD NOT VALID, PLEASE CHOOSE ANOTHER COD". it something like notice to tell me that project cod already not valid yet. It look like "automatic searching" data for every table. It Is possible to do like this?
View 6 Replies
View Related
Feb 18, 2015
I am looking to transfer a number of spreadsheets that I use to track IP Addresses to an Access Database, I have set up the tables and fields, what I would like to do is search for unused IP Addresses from populated table/fields.
View 2 Replies
View Related
Apr 15, 2008
I have a problem trying to sum a numeric column based off another column in the same table.
What I am trying to accomplish is to sum a numeric column if a corresponding column is Not Null.
I have uploaded my sample DB that to illustrate my problem. The query I am testing with is called Query1 and I am looking at summing point values from the task table grouped by the test case those tasks are in. I can easily sum the total number of points for each test case. But when I add another field to the query to sum the point values of the task in the test case that have a date entered into its corresponding date field it will not sum them correctly.
The result I get is the same sum total is shown for all three fields in the query.
I have tried several attempts at making criteria for this to work but nothing seems to work the way I want it too.
Here are my attempts:
IIf(Not (Sum([Task].[Points]))=IsNull("Attempted_Actual"),Sum([Task].[Points]),0)
IIf(Not (Sum([Task].[Points]))=IsNull("Completed_Actual"),Sum([Task].[Points]),0)
Not IsNull("Attempted_Actual")
Not IsNull("Completed_Actual")
My question is:
Is it possible to do want I want all in one select query or would this be something to code in a VBA module and then just call that module in a report?
My plan was to do this all in a query then build a report to display this query.
I have attached my dummyDB file and you can look at the Test_Case Table and expand each test case to see the data I have populated.
Any guidance would be appreciated.
Thanks,
View 4 Replies
View Related
Feb 15, 2006
Hello everyone,
I have a combo box on a form tha displays information based on 2 columns from a table.What I want the combo to do is to allow the user to select the row he wants and for the field that is bound to the combo box to store the outcome of collumn1 + collumn2 (string values).
Is this at all possible and if so how can I do it cause I can't find a way.
Thanks for all your time and effort :)
View 3 Replies
View Related
Feb 15, 2006
Hello everyone,
I have a combo box on a form tha displays information based on 2 columns from a table.What I want the combo to do is to allow the user to select the row he wants and for the field that is bound to the combo box to store the outcome of collumn1 + collumn2 (string values).
Is this at all possible and if so how can I do it cause I can't find a way.
Thanks for all your time and effort :)
View 3 Replies
View Related
Oct 19, 2005
I am trying to get the Total average speed answered (ASA) based on two columns sums. (i.e. sum of calls handled and sum total speed answer). I need to get the total avg speed ans (formula is sum of total speed answer (tsa) divided by sum calls handled). I did an average query for asa but it gives me the avg for the rows(records) of the asa and not of the two columns. I need it for the two columns above. I was trying to change the formula in report design view, but I am not coming out with the correct answer. Are there any suggestions?
Please help!
View 5 Replies
View Related
Nov 19, 2013
What I'm trying to do is create columns based on subgrouping. See attached example in excel.
It's almost like transposing but not it.
The names of the columns don't really matter. It's to be used in a dynamic excel workbook for looksups.
View 5 Replies
View Related
Aug 18, 2012
Is it possible to have a calculated column based on another table. i have a 1 to many table. the table that is the parent hold a start time. all of the 'many' have an individual time length. i would like a calculated column in the parent table showing the full length. is it possible or will i have to use an update query?
View 1 Replies
View Related
Apr 3, 2013
I have a dataset of about 70 columns but would like to remove any two rows that sum to zero (based on two columns) if the column "Units" are the same for the same "Bar code" thus to say "for the same 'Units' (for any two lines), check to see if their respective 'Bar Codes’ are the same and if so remove if their amounts sums to zero".
I have the following code which seems to be working but for relatively large data ( about 5k), it does not select all the data that meets the criteria:
Code:
SELECT *
FROM datatable
WHERE ((([datatable].[Unit] & [datatable].[Bar Code] & Abs([datatable].[Amount]))
In (SELECT datatable.Unit&datatable.[Bar Code]&abs(datatable.Amount)
FROM datatable
GROUP BY datatable.Unit&datatable.[Bar Code]&abs(datatable.Amount)
HAVING count(*)>= 2 and sum(datatable.Amount)=0)))
ORDER BY [datatable].Unit & [datatable].[Bar Code] & Abs([datatable].Amount);
identifying the bug in this code that makes it not pull all the data meeting the criteria.
See sample data below:
# Unit bar Code Amount
1. AAB Mac1 2.75
2. AAB Mac1 -2.75
3. AAB Mac1 1.24
4. AAC Mac3 35.00
5. AAC Mac3 -20.00
6. AAC Mac3 20.00
7. AAD Mac3 16.11
8. AAC Mac2 11.00
9. AAC Mac2 -11.00
10 AAC Mac3 12.05
11 AAF Mac3 -12.05
12 AAD Mac3 -16.11
13 AAC Mac4 35.00
I want to select records # 1, 2, 5, 6,7,8,9 and 12 since they are same units having the same bar code and their sums total zero.
View 6 Replies
View Related
Jun 8, 2012
I've got a data entry form that is used to enter incoming waste consignment data. (I've attached a screen grab of the form) Each screen represents one record and the data is recorded in a table called "IncomingWaste". The top of the form (light blue) refers to the customer/producer of the waste. Most of that detail is held in another table on the db. The bottom (Dark Blue) part is used to record the consignment data. It gives the user a grid to enter the individual waste components within the consignment (choosing from Drop down menus for the various descriptive elements) Most crucially, the weight of each component is recorded.
I have a calculated field at the bottom which gives a Total weight for that consignment. It simply adds the weight fields together and delivers a total in the box at the bottom of the screen which displays the total weight in that consignment using "Nz([weight1])+Nz([weight2)]+ ...etc - which works fine on the form. However, I can't seem to get this calculated total recorded and appended to each record in the table and I assume it must be re-calculated each time the screen loads (?)
The main issues is.... I need to create a report which adds the total weights from each customer over a monthly/quarterly period and I simply cannot seem to do it.
I have created the report which groups all the consignments from each customer and lists them in date order, but I can't identify or define the method I need to use to collect that Total Weight calculation from each consignment record and add them up to give a grand total for that customer for a particular period. I'm assuming if I can crack the first part and get the total recorded in the table, then I can call the value into the report.
View 8 Replies
View Related
Feb 4, 2008
I will need to create a new column in a query with data based off of two columns currently in my DB.
Current fields are: [TestType] & [TestReason].
New TEMP field will be [TestCombo]
TestType has 4 possible option via drop down.
TestReason has 21 possible options via drop down.
TestCombo will be one of 10 options depending on the data in TestType & TestReason.
examples: (here is an example of how the combo field will be populated. There will be ten total rules like this. one for each possible text option in the combo box.)
If [TestType] is "DRUG" & [TestReason] is "PRE" or "RAND" or "PA" then [TestCombo] would be "DOTDT".
If [TestType] is "ALCOHOL" & [TestReason] is "PRE" or "RAND" or "PA" then [TestCombo] would be "DOTAT".
If [TestType] is "DRUG" & [TestReason] is "N-PRE" or "N-OTHER" or "N-FUP" then [TestCombo] would be "NDDT".
The data does not need to be saved anywhere at all in the database, just generated when pulling this query. It will then be exported and dumped into another system.
Thanks. Here is a temp copy of the database with some junk data to maybe make it a little more clear.
View 9 Replies
View Related
Jan 28, 2014
I would like to know if the following is possible: I have a table, I have a form based on that table (datasheet view) and I would like for certain columns to visible or not based on the input on a Combobox (list of countries) that is based on another form.
I have searched on the web and I found that the following:
On a button based on the main menu form:
Code:
Private Sub Go_Click()
Dim stDocName As String
Dim stOpen As String
stOpen = Me!cboDest
stDocName = "Datasheet"
DoCmd.OpenForm stDocName, , , , , , stOpen
and then on the event "on open" of the form Datasheet I have inserted the following:
Code:
Private Sub Form_Open(Cancel As Integer)
Select Case OpenArgs
Case "USA"
Forms![Overflow]![Tasks].Visible = True
Forms![Overflow]![Constant Number (Min)].Visible = True
[Code] ....
I have done it as a test, but it appears that it does not work. It opens the forms, but it does not hide or show the columns based on the option, it brings all the columns.
View 14 Replies
View Related