Display Search Results In Subform

Sep 22, 2006

Hey all,

I did a search and i found a thread that seemed like it would answer my question but for some reason the attachment isnt working. :(

Okay heres the question..

I have a form and it contains 3 fields and 3 command buttons.
When i hit the command button it uses a query to display the results.
What i want to do is instead of having the results display in a new window, i would like it to display on the same form .. maybe on the bottom of it.
Should i use a subform or listbox/combobox..

Can anyone help me figure this out?

Thanks in advance

View Replies


ADVERTISEMENT

Display Query Results In Subform

Oct 5, 2006

If there's a post out there that addresses this, please point me in that direction as I've had no luck.

I have my queries listed in a table. On my form I have them listed in my combo box. The user selects the query they want and hits the command button "Run". I would like to show the selected query in a subform on the main form and then give the user the option of selecting another command button to export the query to Excel.

I thought it would be as simple as setting the recordsource of the subform to the query name in my combo box, but that doesn't work.

Current code to run query in separate window:

Command button "Run"
Private Sub Command9_Click()
DoCmd.OpenQuery Me.Combo2.Column(1)

Attempt at getting what I want:

Privat Sub_Command9_Click()
Forms!frmQuerySelection!sfrmQuery.Recordsource = Me.Combo2.Column(1)
or perhaps
sfrmQuery.Recordsource = Me.Combo2

Am I even close?

Thanks

View 1 Replies View Related

Display Query Results In SubForm

Jan 28, 2005

I have created a query with parameters keyed in from unbound textboxes on a form. Does anyone know of a way to display the results (queried) in the sub-form of the same form (main) the textboxes reside? I have the query set up to create a table but when I use that table (or the query itself) in the subform I get the error message:

"The database engine could not lock table "tablename" because it is already in use by another person or process."

This seems appropriate because I am querying for results, but is there any way to get the results of a query into a form, rather than the more common pop up datasheet? I have tried several macros to open and close the tables - queries - copied tables ..re-opened forms....etc, but can't get it to work.

Thanks, for any help, I have spent some time on this one!!!

View 4 Replies View Related

Main Form To Display Results In Subform

Oct 14, 2013

I have a main form which displays the results in the subform.

My requirement :

I have 1 main form and 2 subforms in that form.

I just wanted to have a get focus function on my 1st subform and needs to display the focusing result in the next 2nd subform.

In Detail :

I had a main form of search boxes Author, Published, title

If you search for 1999 in published text box then it will display all the results whose published year is 1999 along with those respective Author and Title in the 1st subform

In the result 1st subform if an ID is selected by the cursor then that entire row needs to be displayed in the next 2nd subform (As of now I wanted only 2 column details of the focussed result).

1st subform needs to display all the searched results (It was done and it works fine)

2nd subform needs to display the selected results (On Focus) of 1st subform.

How to deal with the 2nd subform linking up with the 1st subform.

Attached is the file. How to proceed further in getting done with the 2nd subform.

MForm is the main form and Main is the main table

View 7 Replies View Related

General :: Main Form Which Display Results In Subform

Oct 14, 2013

I have a main form which displays the results in the subform.

My requirement :

I have 1 main form and 2 subforms in that form.

I just wanted to have a get focus function on my 1st subform and needs to display the focusing result in the next 2nd subform.

In Detail :

I had a main form of search boxes Author, Published, title

If you search for 1999 in published text box then it will display all the results whose published year is 1999 along with those respective Author and Title in the 1st subform

In the result 1st subform if an ID is selected by the cursor then that entire row needs to be displayed in the next 2nd subform (As of now I wanted only 2 column details of the focussed result).

1st subform needs to display all the searched results (It was done and it works fine)

2nd subform needs to display the selected results (On Focus) of 1st subform.

How to deal with the 2nd subform linking up with the 1st subform.

Attached is the file.

View 4 Replies View Related

Have Subform Display Query Results With Command Button

Nov 13, 2014

I have a form with a subform (FindBuffer_Form) which I built from a Query (FindBuffer_Query) within the query criteria I have the following (Like "*" & [Select the main Batch Number] & "*")in order to search a particular number.

I want to be able to run the Query from a command button on the main form and have the results appear in the subform, If I have the Source object of the subform set to Query.FindBuffer_Query I get prompted twice to answer the Criteria before the form opens, after the form opens the subform is generated as per the search criteria.

Ideally, I want the form to open with no data in the subform run the query from command button and have the result in the subform.

View 9 Replies View Related

Displaying Search Results Using Subform Or Other Control

Feb 23, 2006

Hi, I'm just wondering if it's possible to display the result of a query on a subform which does not have a relationship with any other table.

What I'm doing is creating a search form where a query is built from the users input (through combo boxes and text boxes) of what table, attribute and condition they want to search from. When they press the search button, I want the result to be displayed in a datasheet below the selection criteria

The first thing I thought of using to display information with was a subform, but I think the purpose of having the subform is so that it can be linked with a form. So, is there another control or way of displaying results. The results can come from any table.

Thanks.

sugoi_kat

View 1 Replies View Related

Reports :: Search Results Report Shows All Database Records / Not Just Search Results

Apr 29, 2014

I have built a custom search form in a MS Access 2010 database so that users can find specific records to edit. After entering the search criteria and hitting a Search button, another form opens up that shows the search results. This second form includes a command button for generating a report of the search results.

Right now, the custom search form and the search results form are both working properly, but the search results report is showing every record in the database instead of just the search results. This is true whether I access the report via the command button in the form or the navigation pane. I'm not sure if I need to correct my VBA code or the report's properties.

View 4 Replies View Related

Forms :: SubForm To Display Test Results In Date Order

Oct 7, 2014

I am having an issue with the sort order on a subform.

Basically I have a main form with Client Details and a subform hich displays the associated test results for this client. Each client can have multiple test results which should be displayed in date order.

Initially the form was based on the table 'TestResults' and I set up the form with the Orderby property set to the field 'TestDate' and OrderByOnLoad set to True. This didn't work and the records were displayed in random order.

Next I tried setting up the form based on an SQL query with the field 'TestDate' sorted in Ascending order - same result. Tried this with OrderBy and OrderByOnLoad both set/unset as a pair and individually - always the same result.

How can I get the subform to display the test results in date order?

View 2 Replies View Related

Forms :: Search Fields On Form With Results In Subform

Mar 10, 2014

I want to enter text boxes on a form that are linked to certain fields on a table and when search criteria is typed in show the results in a table on a subform.

View 5 Replies View Related

Modules & VBA :: Search Code Deactivates Navigation Buttons When Search Results Are Longer Than A Page

Jun 24, 2015

I have a form that has a subform on it. The main form shows a category of furniture and has custom navigation buttons and a search text box for asset numbers and command button that runs the search. The subform shows the asset numbers associated with that furniture category, sometimes there is only one asset number, in other cases there could be 60. There is a scroll bar to scroll through the asset numbers when there are too many to see in the initial window.

The buttons all work as they should except when I search for an asset number that is part of a category that has too many asset numbers to show in the main window. When this happens the "previous" and "next" navigation buttons do not take you to the previous or next record. All of the other buttons on the form work though - you can go to the first, or the last record, and you can search for a new asset.This is the code for the search:

Code:

Private Sub cmdAssetSearch_Click()
Dim rs As Object
If IsNull(Me.TextAsset) Or Me.TextAsset = "" Then
MsgBox "Please type in an asset number to search for.", vbOKOnly
Me.TextAsset.SetFocus

[code]....

I've also attached a picture of what I mean when I say there are more asset numbers than what the window shows.

View 6 Replies View Related

Queries :: Search Form That Uses A Query To Show Results Of A Search

Aug 5, 2014

I have a search form that uses a query to show results of a search, but everytime I press search everything comes up even though I have entered search parameters, even though my search requeries every time and the search used to work before I added new records today. Also when I press the query alone on the navigation pane it asks me for the parameters and then it actually works but it won't when I use my form.

View 2 Replies View Related

Using Subform For Search Criteria And Relating One Search Field To Several Columns

Apr 21, 2015

1. I created a form with some search-fields which are related to a query. Then I added a Subform in which I put some more Search criteria (So that I can easily hide and unhide those additional searchfields). It sounds strange but is necessary ;-). Now I related those searchfields in the subform to the same query. When I run that query a window pops up that I should put in a value in all those searchfields which are in the subform. But I told Access that it should display all rows, if there is no value in those searchfields. Just as I did it with the Searchcriteria in the Main form. Do I have to do something special, when I have a query which is related to two Forms?

2. I want a searchfield to search in three different columns. Usually the value will just be found in one of those columns. As the Table I search is very long and has many searchfields and multiple of those will relate to more than one column, is there an easy way to do it in VBA? As I did it by using the "or" field when designing a query, but this seems very slow and unstable.

View 6 Replies View Related

Display Qry Results In Text Box

Apr 17, 2006

Hello Experts,
i have this small problem with my qry results not being displayed in the text box.

tbl Issues= status field and many other fields
tbl Status= Active or Closed

here is my qry
SELECT Count(Issues.Status) AS CountOfStatus
FROM Issues
GROUP BY Issues.Status
HAVING (((Issues.Status)="Active"));

I have tried typing this code on the control source of the text box
=DCount("PartNumber","Issues","Status=Active")
but it doesnt work.

All i want to do is display my results in a text box on a form.

Any help
Thanks alot

View 2 Replies View Related

Display Query Results

Nov 18, 2005

When I query my database I want to return groups of records. The groups differ from one another based on one field (Employee ID) -- So one group with Employee ID# 1 may have 2 records and another group with Employee ID# 2 may have 5 records, etc. My question is: What is the best way to display these groupings and allow the user to scroll or navigate thru the different groups easily?
Any help is appreciated.

Thanks

View 1 Replies View Related

ListBox Display Results?

Apr 26, 2006

I'm using the following code to pull results from table: Project Updates

SELECT *
FROM [Project Update]
WHERE Date Between Forms!SelectDates.cboStartDate And Forms!SelectDates.cboEndDate;

How can I then display these results in a listbox on my form?

Thanks.

View 1 Replies View Related

Search Results

May 27, 2005

please can someone help me with a vb code to view search results in a subform such that
double clicking search result on subform displays another form with details of the result.
Heeeeeeelp.
Thanks

View 2 Replies View Related

Queries- Running/Display Results?

Aug 30, 2007

Hey guys-
I have a database of properties for sale. I want to calculate the asking prices of each record (for sale) against the sold prices of all the houses in the same area. Area is defined as a numeric number, and each property has one assigned to it. My question is this-
I have a table of all the properties. Do I run the query and store the results in a specific cell in the table- and then use a form to display those results? Or do I run the query from a form and not store the calculated results at all? I will be adding/updating info on a daily basis, so these calculation results will also change daily. Obviously I am fairly new to Access and trying to figure out how to do this stuff. Using Access 2002. Either way, I assume i'll be using a form to display the results one way or another...
Thanks!

View 8 Replies View Related

Display Multiple BE Table Results

Sep 1, 2007

:confused: I have 3 identical fe be database running each with a table called cars that has identical form values just obviously different data. I want to create a table or query to display all the results from these but whenever i try and make a query i cannot seem to work it out. Anyone got any ideas? :confused:

View 2 Replies View Related

Display Related Query Results Together

Aug 7, 2007

I have been doing a lot of searching on the forums, and I can't seem to find an answer to my problem.

I have a form that uses a query to create an e-mail. This e-mail lists all of the different tests to perform on a sample of a product. My table set up is as follows:

tblProducts
ProductID
ProductName

tblTests
TestID
TestName

tblSamples
SampleID
ProductID
TestID

The purpose of this is to send out a sample of a specified product and perform 1 to XX tests on it.

Currently, my query is giving these results:

Product Test
Product1 Test1
Product1 Test2
Product2 Test1
Product2 Test2
Product3 Test1

I would like for it to format the data like this:

Product Tests
Product1 Test1, Test2
Product2 Test1, Test2
Product3 Test1

Any suggestions on what I should do?

Thanks in advance!

View 2 Replies View Related

Forms :: Display Sum Results In Textbox?

Jul 22, 2014

I am trying to display the sum of a query into a form textbox and i am not having any luck.

Here is my code that i am currently using:

Private Sub Client_Id_AfterUpdate()
Dim db As Database
Dim rs2 As DAO.Recordset

[Code]....

View 4 Replies View Related

Clear Search Results

Jun 28, 2005

I created a search form (using code from here) that searches serveral fields and displays the results in a listbox. I also created a clear button to clear the fields, including the listbox. I can search all day and it works fine, and the CLEAR button clears out the fields fine but once I have clicked the CLEAR button, I cannot search anymore. I don't get any results anymore (until I close and reopen). It must be something simple that I am overlooking so any hints would be appreciated.
Here is my code (sorry it's long!):


Private Sub cmdClearForm_Click()
On Error GoTo Err_cmdClearForm_Click

Dim I As Integer

' Cycle through the form's controls, testing for text,
' and clear each field.
For I = 0 To Me.Count - 1
If TypeOf Me(I) Is TextBox Then
Me(I) = ""
ElseIf TypeOf Me(I) Is ListBox Then
Me(I).RowSource = " "
End If
Next

Me.txtMacAddr1.SetFocus

Exit_cmdClearForm_Click:
Exit Sub

Err_cmdClearForm_Click:
MsgBox Err.Description
Resume Exit_cmdClearForm_Click

End Sub
Private Sub cmdSearch_Click()
On Error GoTo Err_cmdSearch_Click

Dim strSQL As String, strOrder As String, strWhere As String, strOrderChoice As String
Dim db As DAO.Database
'Dim qryDef As QueryDef
Set db = CurrentDb()

strSQL = "SELECT tblAsset.MacAddr1, tblAsset.SerialNum, tblIPAddresses.IPAddress,tblIPAddresses.HostName, tblLocation.JackNumber, tblLocation.CircuitID, tblLocation.Department,tblLocation.SpecificLoc, tblLocation.User, tblLocation.Building, tblLocation.RoomNumber " & _
"FROM tblAsset, tblIPAddresses, tblLocation " & _
"WHERE tblAsset.AssetNum=tblIPAddresses.AssetNum and tblAsset.AssetNum=tblLocation.AssetNum"

strWhere = " and "
strOrder = "order by"
strOrderChoice = "tblLocation.Department"

If Not IsNull(Me.txtMacAddr1) Then
strWhere = strWhere & "(tblAsset.MacAddr1) like '*" & Me.txtMacAddr1 & "*' and "
strOrderChoice = "tblAsset.MacAddr1"
End If

If Not IsNull(Me.txtMacAddr1) Then
strWhere = strWhere & "(tblAsset.MacAddr2) like '*" & Me.txtMacAddr1 & "*' and "
strOrderChoice = "tblAssest.MacAddr2"
End If

If Not IsNull(Me.txtSerialNum) Then
strWhere = strWhere & "(tblAsset.SerialNum) like '*" & Me.txtSerialNum & "*' and "
strOrderChoice = "tblAsset.SerialNum"
End If

If Not IsNull(Me.txtIPAddress) Then
strWhere = strWhere & "(tblIPAddresses.IPAddress) like '*" & Me.txtIPAddress & "*' and "
strOrderChoice = "tblIPAddresses.IPAddress"
End If

If Not IsNull(Me.txtHostName) Then
strWhere = strWhere & "(tblIPAddresses.HostName) like '*" & Me.txtHostName & "*' and "
strOrderChoice = "tblIPAddresses.HostName"
End If

If Not IsNull(Me.txtJackNumber) Then
strWhere = strWhere & "(tblLocation.JackNumber) like '*" & Me.txtJackNumber & "*' and "
strOrderChoice = "tblLocation.JackNumber"
End If

If Not IsNull(Me.txtCircuitID) Then
strWhere = strWhere & "(tblLocation.CircuitID) like '*" & Me.txtCircuitID & "*' and "
strOrderChoice = "tblLocaton.CircuitID"
End If

If Not IsNull(Me.txtBuilding) Then
strWhere = strWhere & "(tblLocation.Building) like '*" & Me.txtBuilding & "*' and "
strOrderChoice = "tblLocation.Building"
End If

strWhere = Mid(strWhere, 1, Len(strWhere) - 5)
Me.lstResults.RowSource = strSQL & " " & strWhere & " " & strOrder & " " & strOrderChoice

db.Close

Exit_cmdSearch_Click:
Exit Sub

Err_cmdSearch_Click:
MsgBox Err.Description
Resume Exit_cmdSearch_Click

End Sub

View 4 Replies View Related

Highlight Search Results

Jan 2, 2006

Good Day All,

I have a wild card search query (Like "*" & [Forms]![search]![Text0] & "*") that works very well. I want to be able to have the phrase that user types in highlighted when it returns the search results on a form. I found the following thread that asks the same question using Conditional formating, but the suggested answer doesn't work. Any ideas?


http://www.access-programmers.co.uk/forums/showthread.php?t=73845&highlight=highlight+search

View 3 Replies View Related

Filtering Within Search Results

May 26, 2006

Whats the best way to filter search results?

I'll do my best to explain my problem:

I made a form that lets users search for records in a database and displays them in another form. In that form I've made 3 buttons to let users narrow down the results to show only certain items within the search results.

Now, 2 of the buttons show specific items and the third one toggles the form to display all the records. So lets say I'm filtering records by whether or not they contain the words "car" and "truck." If a record has "car" but not truck and I click the button to sort by "truck" then the search result goes blank, which is ok. But if I click "car" or "show all" to display everything again then the search result stays blank.

This doesn't happen with records that contain both "car" and "truck."

For every button I have something like this: DoCmd.OpenForm "AdminSearchResults", , "SOW", "VendName = '" & VendName & "'", , , "'VendName'"

I know my explanation may suck, but if anyone can help me, that would be great, lol

View 3 Replies View Related

Forms :: Calculate Subtotal On Subform And Display On Upper Subform

Jun 20, 2013

im having problems getting a subform to calculate another subform's total and display it as it keeps coming up with the #NAME?.Basically my database is like this

tblCustomer
- tblOrders
- tblItems

and this is displayed on a form. so you can flick through clients, then flick through the orders and its broken down into the items inside each order.i have seen many answers that are only about calculating something on a subform and displaying on a form but this does not work when displaying on a 'parent' subform. the form structure looks like this

frmCustomers
- sFrmCustomerItems
- sFrmCustomerOrders

i have a calculated control textbox in the footer of sFrmCustomerOrders with sums up all the prices using =sum([Price])and in my sFrmCustomerItems, i have a field called Amount (the total amount of all the items) and the Control Source formula i was using was =[Forms]![sFrmCustomerOrders]![sFrmCustomerItems]![txtTotalPrice] but i get a #NAME? error.

View 5 Replies View Related

Doubleclick Field To Display Query Results

Sep 5, 2006

Hi, can anyone tell me how to doubleclick on field (on a form) and it opens up a form that shows bounded filtered results. I have a sub form which has details supporting summary numbers. I want my user to doubleclcik on the currency field and the detail supporting that sum total, pops up automatically. Any help please? :confused:

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved