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..
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
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!!!
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.
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.
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.
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.
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.
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?
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.
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.
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.
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.
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.
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
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!
: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:
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.
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
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()
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
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?
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
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
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.
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: