Two Forms, Same Text Box Query
Dec 19, 2004
Hi,
I have a form which allows me to search between two dates by using two text boxes. The code for the query behind the text boxes is:
Between [Forms]![name of my form]![name of text box1] And [Forms]![name of my form]![name of text box2] and it works great. However, I was wondering if it was possible to use the same two text boxes on another form running from the same query, or would I have to make another query for the other form? I have tried to use "or" in my statement, eg.
Between [Forms]![name of my form]![name of text box1] And [Forms]![name of my form]![name of text box2] Or Between [Forms]![name of my 2nd form]![name of text box1] And [Forms]![name of my 2nd form]![name of text box2] but when I try the text boxes it says "Enter Parameter Value".
Thank you for all your help.
View Replies
ADVERTISEMENT
May 10, 2014
I have a form with a combo box at the top that works fine. The combo box is linked to a table that has 5 parcels of land with area size, address, type. On my form i need to populate a textbox with a formula depending on what parcel of land was selected at the combo box. Such as price x area of land selected.
View 1 Replies
View Related
Sep 29, 2014
I am using Office 2007 and have a form that is linked to a query, also I have a sub form linked to the same query. I cant understand why both forms say in their properties that they are linked to a query but when I try and add a text box to show customer ID it tries to show data from a table
View 1 Replies
View Related
Mar 5, 2014
I have a textbox on a subform to allow a delivery qty to be entered (to allow me to cater for part deliveries). I have a query which totals up the values of this field (so that I have a total of all the deliveries for this record) and compares that value against another field (to check that the total deliveries I have entered do not total more than the ordered qty). I am using this query within the "Validation Rule" of the textbox. My problem is that when I enter the values for the first time this works fine because the figures are not yet part of the query and therefore the check works fine, however if I try to modify a figure I've already entered it triggers the validation each time because it tries to add the new value to the query total.
View 3 Replies
View Related
Jun 24, 2013
I have a Columnar Sub form for for a Sales order for capturing the item details.
I have setup a combox for item code for which the respective item description data has to be fetche from item master table and populated in itemdesc table.
I am written a after update code in the combo but after selecting each row the item being fetched and updated in all rows is of the last row.
*********
Private Sub itemcode_AfterUpdate()
Me.itemdesc.Value = DLookup("[Description]", "itemMaster", "[code]='" & [Forms]![frm_invtmpDetails]![itemcode] & "'")
End Sub
*********
View 7 Replies
View Related
Jan 28, 2014
I have a function in a module that looks like this (it takes 2 dates as arguments):
Code:
Function get_KPIScanAgeRange(in_ScanDate As Date, KPIDate As Date) As String
Dim ret As String
ret = "Invalid"
' return value, by default is because age is negative number
[Code] .....
I'm trying to pass the date in a text box which exists in a form called "d3FormAging". The text box name is "KPIDate". The query looks like this:
Code:
SELECT Query_d3_Open.[Company No], get_KPIScanAgeRange([Scan date],[Forms]![d3FormAging]![KPIDate]) AS KPIScanAgeRange, Count(Query_d3_Open.[Scan date]) AS Scans
FROM Query_d3_Open
GROUP BY Query_d3_Open.[Company No], get_KPIScanAgeRange([Scan date],[Forms]![d3FormAging]![KPIDate])
ORDER BY Query_d3_Open.[Company No], get_KPIScanAgeRange([Scan date],[Forms]![d3FormAging]![KPIDate]);
For some reason Access doesn't recognize the "[Forms]![d3FormAging]![KPIDate]" when I pass it to the function. I get run-time error 3070 with information that Access can't recognize this expression even though the code should be correct as it's made with the expression builder and I'm sure the form that contains the text box is open when the query runs.
View 2 Replies
View Related
Apr 16, 2013
I am using Access 2007. Second, I am using two tables, Inventory and Service Request. Inventory is a list all the Inventory, with has things like location (building & room number), type (desktop, laptop, etc.) and access tag number. Service Request also has Access Tag Number (should link back to Inventory) & date of reported/resolved problem and description of problem/solution.
On my form for Service Request, I have the access tag number as a fill text box, when you double click on that text box, it runs a Query that asks for the 1) Building, 2) Room Number & 3) Type . . . Query currently opens in a the spread sheet view that shows those three things but also the Access Tag Number associated to them.
I would like that Access Tag Number to just return into the field that was double click to start the query.
Is this possible? If so what am I missing?
View 1 Replies
View Related
Jun 7, 2013
Can a query be used as a control source for a text box on a form?
=[QueryLibrary]![Kit] is the control source do I need to change anything else?
View 3 Replies
View Related
May 6, 2014
I am making a database for my work place where there is telephone counsellors and they need to complete a certain number of supervision hours and a few other categories of hours required for training and several other things. The manager wants to be able to see the total supervision hours and the other categories for a worker when the worker is selected and the date range for the queried time entered.
I have a form that has quite a few items on it. I have two text boxes that allow me to enter a start date and an end date, I have a combo box that allows me to select a worker and I have 3 text boxes that I want to populate with the sum of 3 separate columns in another table when the date is entered and the worker selected so the manager can see, at a glance, how many hours each worker has done on the separate items. Maybe I would need an update button at the bottom that, when clicked, would perform the required calculations.
I have 3 queries that return the required information but I need to get one of the columns from the query results put into each of the 3 text boxes. Basically, when I click on the buttons the right query appears, I just want column 3 (which is a sum column) to get put in the corresponding text box and I want all the boxes to display the sum of their corresponding queries when a date and person is selected.The form is called frmSearch, the 3 queries are called qry_sumisshours, qry_sumisshours and qry_sumtcshours. The 3 text boxes I need to get populated from the queries are called txt_ results_ sv_ hours, txt_results_TCS_hours and txt_results_iss_hours.
View 10 Replies
View Related
Oct 28, 2013
I have successfully put together some VBA code that will accept a user's input into a textbox on a form. A cmdFindprinter button is clicked and the query is ran. The user is asked via an inputbox for their login ID so that the query is exported to a text file on the desktop. The query then pops up in a new tab and also automatically exports the queried record to a text file on the desktop. I have upward of 30 users using this form at any given time and I need the following automated.
What I would like to do is to have the text file go into a specific format. For example:
IP address:
Serial number:
Location:
The name of one of the queries is "Xerox IP Query", the field names would be "IP Address", "SerialNumber", and "Site Name".
This is what comes up in the text file right now:
"CXF345946","157.229.243.58","123 Happy Ave"
I'd like to remove the quotes and have the info fall into place as shown in the example above.
This is the code so far:
Code:
Private Sub cmdFindprinter_Click()
On Error GoTo cmdFindprinter_Click_Err
Dim strPath As String
userNT = InputBox("Please enter your NT ID", "ServiceBase Xerox Printer Query", "Enter your NT ID")
strPath = "C:Users" & userNT & "DesktopPrinterQuery.txt"
If Heading = 0 Then Exit Sub
[code]....
View 4 Replies
View Related
Dec 15, 2014
I've created a form with two textboxes and a listbox. What I want to do is to show in the listbox the registers filtered by the 2 textboxes. But I would like that the listbox refreshes while typping in the textboxes.It was no problem to do filtering with only one textbox. The rowsource of the listbox is a query in which I set in the criteria Like [Forms]![Form1]![Textbox1].[Text] & "*"Then I write the code for the change event of the Textbox1:
Private Sub Textbox1_Change()
Listbox1.Requery
End Sub
With this I have no problem. The problem is when using the 2 textboxes. I write the same in the criteria, Like [Forms]![Form1]![Textbox2].[Text] & "*", on another field but it doesn't work. I also write the code for the second textbox:
Private Sub Textbox2_Change()
Listbox1.Requery
End Sub
The listbox doesn't filter with both textboxes. When you type in one of them, the listbox filters from it, but when you type in the other textbox, the listbox shows the whole table filtered with the characters of the second textbox.
View 10 Replies
View Related
Jul 16, 2015
is it possible to use a sum select query in the control source field of a text box. I have a query that works fine in a combo text box but I keep getting a 'syntax error with subquery parenthesis' when I try and build on in a normal text box.
I am building the query using query design view and the query works and then I'm copying the SQL code behind the query into the text box field and access reformats it s a bit so not sure it's that's the reason.
R_P_Data_P = Table
approvalNosys = Field in the table
status = Field in the table
score = Field in the table
cmrOverview = Form
[approvalNoSys] = field in form
1 is the criteria
Code:
SELECT R_P_Data_P.approvalNosys, R_P_Data_P.status, Sum(R_P_Data_P.score) AS SumOfscore
FROM R_P_Data_P
GROUP BY R_P_Data_P.approvalNosys, R_P_Data_P.status
HAVING (((R_P_Data_P.approvalNosys)=[forms]![cmrOverview]![approvalNoSys]) AND ((R_P_Data_P.status)="1"));
View 7 Replies
View Related
May 7, 2014
How do I get a certain column of a query result pasted to a text box when I open the form?
View 2 Replies
View Related
Jul 3, 2014
I have the need to display the return of my "Sum Query" to display in a text box.
I need the attached below value (40500) in the "SumofQuery" attachment, which updates every 5 minutes to display on the "StatusBoard" attachment text box.
I have been searching for a good 10 hours on how to do this and still cannot find it.
View 14 Replies
View Related
Oct 10, 2013
I have a table that holds the SQL texts for ca. 1000 Select queries (mostly minor variants that are used to programmatically swap out RowSource strings for combo boxes). I'd like to have a quick and easy way to open/review/modify these queries.
One strategy would be to display the SQL strings in a field on a Datasheet form, then use an onClick event on a text box linked to the SQL-holding field (or perhaps an onClick event tied to an unbound text box on the form) to open the associated query. That would allow me to view the SQL of the query that I want to open, allow me to quickly scroll through the list of stored SQL texts, and give me options for sorting or limiting the SQL-texts displayed in the datasheet form.
But, I can't seem to get the onClick event to work. The problem seems to be that I can't figure out how to pass the SQL string contained in the field to a function that will use that string to open the query .
View 10 Replies
View Related
May 29, 2015
DLookup function. (this is for a stamp collection database).
On my form ("InventoryInput") I have a text box called "Catalog" for a numeric entry and a text combo box for selecting a "Country" in drop down list.
I want to query a table called "CatNameList" to get the "StampName" of the item (based on the entries of Catalog and Country) and populate that name in the text box. The fields in this table are called "StampName", "CatNumb" & "CName" respectively.
I have successfully placed the following expression in the control source of that textbox and able to populate the StampName I need based solely on the catalog number alone.
That express is :
=DLookUp("StampName", "CatNameList", "CatNumb = Form![Catalog]")
So it will populate the "StampName" data to match the "Catalog" number entry just fine.
However, I need to add a second layer to incorporate the Country.
Example : There is a catalog "1" for "USA", and a catalog "1" for "Canada" but both have different "StampName".
I have been attempting to get that second piece added with no success. Here is the expression I have been trying to get to work :
=DLookUp("StampName", "CatNameList", "[CatNumb] = " & [Catalog] & " And CName = '" & [Country] & "'")
Right now, the text box is just blank with the above expression. I thought it may be because there was no match found, but I have triple checked to ensure I have the spelling correct on the country name in both places.
Basically, I just need the dlookup to take the "catalog" and "country" off the form and match it to the "CatNameList" table fields of "CatNumb" and "CName" to give me "StampName" field back on the form.
View 4 Replies
View Related
May 6, 2015
I have a BE database, that when opened, opens a form for saving the results of a query to a text file on the desktop. It works fine, if the full path is entered.
The problem is, I want this saved on any users' desktop. I did some digging and found the %userprofile% variable, which when used, gives me the error.
I understand this should work in both Windows XP and Windows 7, which are the environments the full DB will operate in. So far the "EXPORT" button on the form has the following for the code:
Code:
Private Sub BTN_Export_Click()
DoCmd.TransferText acExportDelim, , "QRY_ExportPublicComment", "C:UsersMark N. McAllisterDesktopPubComExp.txt"
End Sub
When I tried this:
Code:
Private Sub BTN_Export_Click()
Dim strPath As String
strPath ="%userprofile%desktopPubComExp.txt"
DoCmd.TransferText acExportDelim, , "QRY_ExportPublicComment", strPath
End Sub
the error occurs.
View 10 Replies
View Related
Mar 22, 2014
I have 4 fields that are unbound on a form. img1 img2 img3 img4..When these are entered they are all combined and autofill another unbound textbox = imagename.. what i would like to do is from this unbound textbox 'imagename' ..i would like to populate a textbox that IS bound called FileName
[Event Procedure]
Private Sub imagename_Click()
Me.imagename = Me.FileName
End Sub
View 4 Replies
View Related
Jan 6, 2014
My database has Main form and a Sub form. On main form i place one unbound text box named investigations. In subform of which datasheet there is a column named TestCode. I want unbound text box (Investigations) to display row values which selected in a column (TestCode) of subform.for example:Investigation field should display "CBC,HB,ALP".
View 5 Replies
View Related
Jul 12, 2013
I have a Form Display Data in my Access Database, which is working really well. However, users was asking if there is a way we can make Font Color Could/would change if The text in A field or Any field in my display form contained the word "SAD or MAD". Is there code for such thing in display form?..
View 3 Replies
View Related
Nov 12, 2013
I am trying to search on EmployeeID field and populate corresponding data like EmployeeName, EmployeePay in other text boxes in the same box .
In my Unbound Form I have three unbound Text Boxes and one Command button:
txtEmpID
txtEmpName
txtEmpPay
cmdFind
In my table EMPLOYEE i have three fields
EmpID -- Autonumber
EmpName -- Text
EmpPay -- Text
View 2 Replies
View Related
Nov 21, 2013
how can i disable a textfield or two in a form when the textbox is unchecked also how do i add a default value for it while the textbox itself is disabled, can i get away with it by adding a default value on the textbox?
View 14 Replies
View Related
May 10, 2015
I have a form with two text boxes and a button. I want to be able to type a value into the first Text box click the button and the second text box to be filled with the value which is stored in the Table.
The first Textbox is called barTxt, The second Textbox is called CustTxt The button is called SearchBtn and the Table is called BookInTable. I have been trying to use the code.
Code:
Private Sub SearchBtn_Click()
DoCmd.FindRecord Me.BarTxt.Value, , True, , True
CustTxt.Value = "SELECT BookInTable.Customer FROM BookInTable " & _
" WHERE Customer = """ & Nz(Me.BarTxt) & """" & _
" ORDER BY Customer"
End Sub
This however instead of displaying the Value for customer which is stored in the BookInTable. Displays The code SELECT BookInTable.Customer FROMBookInTable " & _ " WHERE Customer = """ & Nz(Me.BarTxt) & """" & _ " ORDER BY Customer"
View 6 Replies
View Related
May 14, 2013
I want to enter text in an unbound text box and for it to be repeated in another on the same form.
View 6 Replies
View Related
Feb 14, 2014
I want 2 text , when I add a name to text 1 automatically set number to text 2 (Random),
View 3 Replies
View Related
Dec 28, 2006
I have a column which contains "text digit text" as "AAA 222 BBB". The numbers of letters or digits can vary.
I need to SELECT the column which contains digits in a specific interval. For Example I have
"DFS 673 JKK"
"A 3454 LJLJ"
"SD 854 JKLJD"
I need to SELECT the column which contains 600 < Digit < 700 the result of the query in this case would be "DFS 673 JKK" because 673 is between 600 and 700.
Thanx for any clue or suggestion...
View 1 Replies
View Related