General :: Enter Value In A Form / Run Query And Display Result On Form
Jun 15, 2013
Is there an easy way of entering a value in a text box, passing to a query to do a count function and then return the value of count function in to anther text box?
First, I am a beginner with Access. I am a graphics designer that has been assigned to cover for a db programmer that quit!
Here is my problem:
I have a database that we use to hold customer information. There are 22 fields in each record, and we are now well over 3000 records.
Once upon a time, to find a specific customer, we would just go to the bottom of the page, and use the arrow buttons to scroll through them all. This is no longer possible as the size is too big to manually search.
What I would like to do:
Upon Access startup, display a form that has a single input field and a button titled "Search". The input field is titled [UserName], as this field is the unique key identifier for the record. When the user types in the UserName and clicks the SEARCH command button, another form appears to display JUST THAT RECORD in the easy to read form!
If this is really basic, I appologize. I have 20 years experience with commercial illustration and only 7 days experience with Access. I have purchased books, and hit the forums, but I am not a VB programmer, and my skills this area are REAL weak!
My resourse books include the following: Wiley - Access 2003 Bible [Prague, Irwin & Reardon] Osbourne - How to do Everything with Access 2002 [Anderson] O'Reilly - Access Cookbook [Getz, Litwin & Baron]
The VEH and POS are just going to be Labels in a form....no prob. Each Soldier's Squad and Team (for mounted Vehicle and Position) are stored in the Personnel Table. The below query is for vehicle A7 (ACTUAL would be the same as TC above). The query works. I just need to know how to get the result to display in a text box. What I'm planning on doing is creating text boxes for each posistion with these small select queries, so when I update the SQD and Team in the Personnel Table it updates on this form. Or is there an easier way to do this?
Dim strSQL as string strSQL="SELECT [tblPERSONNEL]![RANK] & " " & [tblPERSONNEL]![LAST_NAME] AS NAME FROM tblPERSONNEL WHERE (((tblPERSONNEL.SQD)="A7") AND ((tblPERSONNEL.TEAM)="ACTUAL"))"
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.
I am building a Inventory Management Application for Tyre Shop. I have SaleMainTbl and SaleDetailTbl both used for preparing daily sale summary. I have Mainform based on SaleMainTbl with TxnDate and Total Amount (Sale) and the TxnDate is in one to many relation with SaleDetailTbl. FormSaleDetail is multiple row(continuous) form that makes billwise summary of each day having -TxnDate--BillNo--ItemSold--Company--Qunatity--Rate--Amount fields. I have inserted this form in FormSaleMainTbl.
So FormSaleMainTbl is Main form and FormSaleDetail is subform. TxnDate in FormSaleDetailTbl is automatically taken from SaleMainForm. I have further added text boxes in Main Form to show company wise sale for each day for which there is a query build one for each company that takes the currently loaded date from FormSaleDetail and calculates the Sale (Sum) of each brand (Company) of Tyres. All these objects are working very fine. However I have to close the MainForm and reopen it for result of query to appear in the appropriate text box in Main form.
Is there way to do this as soon as record is entered or at least at the end of completing the entry of each days sale transactions without closing the form. So the gist of the problem is realtime display of query result in text box on a form or updating the form screen immediately on updating any record or at the most after completing the updating of form but without having to close the form.
I'm trying to use the job number field, which is my primary key in my table, to auto assign the new job number on my Forms. Currently, I have to enter a new job number manually, and it has to be unique because that is the way I have it set. I can't use autonumber because Access does not allow you to select what number you would like to start from, which would not play well with my current job numbers.
Basically I need Access to get the job number from the last record and add 1 to it, or just find the last / highest current job number and add 1 to it.
I created a query (qryFindJob#s) that list all of the Job Numbers, but I'm not sure how to add the query results to my Form to display the Job number + 1. I created a text box, typed a simple expression in the control box to see if I was on the right path (=[qryFindJob#s]) but I keep getting a #Name? error in the txt field.
I have a database that I have created for work. On the form I have several dlookups running. A couple of them show up as expected. But most of them are showing up blank. That is until you click on the box, then the result appears. Changing the Locked and Enabled settings does not resolve this.I have the database locked up for normal users. When I access it by holding shift while opening, when I access this form, the dlookups all show the desired results. No clicking on the boxes required.
I've tried refreshing, but that doesn't work. If I write code that loops through all of the textbox controls, setting focus on them and moving throuhg the form, then the results will show up. Basically having VBA click on the boxes for me. Although this works, there is a slight lag and screen flicker as it sets focus to all of these textboxes.
I have a bound form which is from tblEmployee, I'd like to have a dataset below (like a splitform but not a split as they have limits) so when i search in the box it gives me say all the smiths - i select for example david smith and it displays his information in the form objects above so they can be edited?
I want to add a number to my results within a query depending on the month and how many results. For example I have 10 results in my query 3 from January, 5 from March and the rest from April. The 3 from January would be 1,2,3. The five in March would be 1,2,3,4,5 and so on. Is it possible to do?
it is zip file unable to get the size lower yet minimal amount in database I have 2 tables and one form when I create an query on the form the form then becomes that I cannot enter data in it or edit etc
I created a form that allows users to enter data into the fields and populates the table.But can I have it do that and populate instead of one table, two tables?
So, I've got a frmCustomer and want to link the form to frmNewWorkOrder using a button.
More precisely when I choose/scroll to a customer and click the button "New work order" to autofill data from selected client from frmCustomerto frmNewWorkOrder (First and Last name, telephone number and client ID).
Whenever I open the form 'TrainingF' I get the 'Enter Parameter Value' msg box. I tried to look online but could not get rid of it. I have attached the file.
I'm creating a simple database to document our supplier's contact information, addresses etc. However, when I create a combo box on the form and try to enter a record not on the list it gives the message "The Text You Entered Isn't an Item in the List".
Days on Hold: calcworkdays([on hold date],[off hold date])-1
Now i have a module thingy set up (calcworkdays) which works out working days. What this expression does, when theres an on hold date and an off hold date is work out how many working days something is on hold.
Now, problem is, not always is something on hold, therefore fields are often blank and then i get a result in query that says "#Error", but i want to use the answer to this expression in another formula, but when error is displayed it makes the other query show error too.
What I want is some sort of If statement or similar so that if no results exist to display "0". Can anyone tell me how to add this in?
I'm a total Access Noob, it took me forever to work out this working days thing (damn access for not being as simple as excel!)
I think my problem might lie in the way the function has been written. I think i might have to modify this to show "0", rather than "error"
This is what ive got in the function.
Public Function calcWorkDays(dteStart As Date, dteEnd As Date) As Long Dim i As Long 'day counter Dim dteCurDay As Date 'set i = 1 if you want the first date to count as a full day 'or i = 0 if you do not want the first day to count as a full day
i = 0 dteCurDay = dteStart Do Until dteCurDay >= dteEnd 'check date against holiday table If 0 = DCount("[HolidayDate]", "tblHolidays", "[HolidayDate] = #" & dteCurDay & "#") Then 'continue checking for weekdays If Weekday(dteCurDay, vbSunday) <> vbSunday And _ Weekday(dteCurDay, vbSunday) <> vbSaturday Then i = i + 1 End If End If dteCurDay = DateAdd("d", 1, dteCurDay) Loop calcWorkDays = i End Function
I wish to print the result from query in a subform. In my main form, I had a textbox call 'year' which asking user to input a valid year. The query will have to find out all the records that are in that particular year, one year before and one year after. After that, it should display the result in datasheet form. Can anyone out there help me in this matter?
My second question is Can we use crosstab query in the subform?
I have a simple database I am trying to put together. One table, one form, very vanilla. I created a query that ranks values that I enter in a table. I would like to put the result of the query (the rank) next to the value in the form itself. I thought if I created a text box and entered the rank field in the text box, that would be it, but when I run the form, I get "#Name?".
I have a query the SQL view is SELECT Max([customerID]) AS Total FROM tblCustomer WHERE (((Left([CustomerID],3))=[forms]![frmNewCustomer].[txtFirst3])); I run the query and the result is Total BIS007 How do I get Total into a text box on my form so that I can use it?
I have a result for a query made from four different tables for which I would like to refine the result of this query grouping multiple rows into columns.
Attached is a pdf file showing the results being obtained by my query and underneath is how the result would like it be after running the query.
Iv added a 'subform/subreport' to one of my forms.I wanted to use this to display a report. Therefore i assumed that i would simply set the source object to my desired report and hey presto! But no, when i look in the source object drop down list, my report doesnt appear.how i can display a report within a form??
I'm working on an existing 2010 database that has a table that stores PDF's in an OLE field. The boss wants to be able to see the PDF on a form along with the other fields in the database. He doesn't want the pdf to open up in a separate window in Adobe PDF viewer. He doesn't want to have to switch between 2 windows because he's comparing data from the other fields in the record to what's on the PDF. He doesn't have dual monitors and doesn't want that either.
when I put the PDF field on a form all I get is an ICON that has to be double clicked on to open but I need it to display the pdf or at leas part of the PDF so he can scroll down to view the whole pdf. I thought about using a subform or tabs and putting a web browser control to display the pdf. I've seen examples of how to set a web browser control URL when the pdf is in an attachment field but I haven't been able to find any examples of how to view the pdf in a web browser control or any code to actually show the pdf on the form from an OLE field.
I know storing the PDF in an attachment field is the best way to do this and I've let the boss know. My only task is to display it on a form and not to redesign the database.
Does anyone know if it's possible to show the results of a query on a form? I have 4 people entering various "outcomes" into a table. There are a possible 8 different outcomes and the one i'm interested in is the "completed" outcome. I would like to be able to show on the form used to enter the data, the total number of "completes" so far.