Forms :: Generate Custom Form Based On Query Results
Dec 11, 2013
I'm trying to track daily production at a manufacturing company running many different processes at different locations each running multiple parallel "lines." The tricky part is that the number of lines running and the shift schedules e.g. 2shifts 10hrs/day 4days/week or 3shifts 8hrs/day 5days/week change frequently for each process.
Right now I have a form for process data that specifies the schedule and number of lines running each day. Then I'm running an append query to a "production" table that generates blank production records associated with each item made in each process for the correct shift/line combinations.
Up to now I've been manually changing the date on the append query each time I run it. Then I have a seperate query for each process that pulls out the production records for each day. My problem is that the preferred interface for production data entry is a spreadsheet with the following layout:
--------DAYS LINE 1 DAYS LINE 2 SWING LINE 1 SWING LINE 2
ITEM 1 100
ITEM 2 2250
ITEM 3
which changes each time the shift/line schedule changes for each process. The only way to achieve this layout I know of is a crosstab query which isn't updateable. Ideally, each day the manager will specify the shift schedules and forms will be automatically generated with the correct structure and sent to the process supervisors. I'm open to different form layouts and even redesigning the database completely.
I have got a form (name: SearchForm) that displays results of a query (name: AircraftSearch). It is a continuous form displaying multiple results of a search done by the query. I need to be able to send an e-mail to multiple recipients chosen from results displayed on the form.
One of the form's field (a text box called: EmailToOperator) is containing e-mail address to an aircraft operator selected by the underlying query. I need to be able to place a check box button (or something similar) that is going to select the e-mail address. The tricky part is to have multiple check boxes allocated for each record displayed on the form and have them working independently.
The second task is sending a one message (via Microsoft Outlook 2010) to chosen multiple recipients (with no attachments) having the recipients' addresses not visible to each other.
I have tried numerous things to try and create a pop up message or form to alert users of a timing conflict in a scheduling program. I am not real familiar with codes and am not sure how to handle this.
I used Jason Browne's web site to help me construct a query that will list a result of time conflicts (ie some project is scheduled to occur before another one is completed). What I need to have happen is the alert message or form opens when this conflict occurs but does nothing when the timing is ok.
I am not very familiar with code and am having a road block mentally. All help is appreciated!
I have 2 form controls one a combobox and the other a text box. The text box select the site (txtLocation) where the user can enter part of the name of the site and all sites with those characters are returned. I've done this by adding:
Code: Like [Forms]![frmSearchDB2]![txtLocation] & "*"
into the criteria on the Site field in the query design editor.I also want the combobox to have an affect on the query. I want it to query on user status. However if the combobox reads "All Users" I want it to return all status's and all null values. In the criteria field I put:
Code: iif([Forms]![frmSearchDB2]![cbxUserStatus] = "All Users",like "*",[Forms]![frmSearchDB2]![cbxUserStatus])
It kind of works but no null values are pulled back. Should it be an expression?Do I need to do it in VBA?
I have an ID field that I want a custom ID generated based on Name, Phone Number & Record Number.
Here is the code I'm currently using....
'User moved out of supplier name field Public Sub SupplierName_LostFocus() If Me.NewRecord = True Then 'If user adidng new supplier SupplierNameTemp = UCase$(Left$(SupplierName, 3)) 'Store 3 characters from supplier name End If nd Sub
'User moved out of suppliers phone number field Public Sub SupplierPhoneNo_LostFocus() If Me.NewRecord Then 'If adding a new supplier supplierPhoneNoTemp = UCase$(Right$(SupplierPhoneNo, 4)) 'Get 4 right characters of phone # End If End Sub
I then have a procedure which combines the two strings such as....
Private Sub GenerateSupplierId() SupplierID=SupplierNameTemp+SupplierPhoneNoTemp End Sub
The problem is when I check the SupplierPhoneNoTemp & the SupplierNameTemp within the GenerateSupplierID procedure. The contain no information meaning the SupplierID will have nothing as well.
However, when I check SupplierNameTemp within the Public Sub SupplierName_LostFocus() & SupplierPhoneNoTemp within Public Sub SupplierPhoneNo_LostFocus(). They both contain the proper info. It seems they loose this information when moving outside their procedures.
Does anyone know why this would happen & how I could fix this?
Okay I have a report (rptHorneOstbergQuestionnaire) that is based on a query (qryrptHorneOstbergQuestionnaire). In the report I have a total (HOTotal) which is the result of an expression created in the qry. Based on this result I would like to generate text in a text field (HOType) that is found in the same report.
Basically if the field HOTOtal shows any vaue between: 16 and 30 then I want the unbound text field to show the text Definitely evening typw and so on ...(see case statement below)
I thought I could do a case statement on report open but I am getting an error that my expression contains no value.
Here is the case statement
Private Sub Report_Open(Cancel As Integer)
Select Case Me.HOTotal
Case 16 To 30 Me.HOType.Value = "Definitely evening type" Case 31 To 41 Me.HOType.Value = "Moderately evening type" Case 42 To 58 Me.HOType.Value = "Neither type" Case 59 To 69 Me.HOType.Value = "Moderately morning type" Case Else Me.HOType.Value = "Definitely morning type"
I am trying to make an automation in order generate reports based on query ( person name,person email address ) , export them to a folder in PDF and then send them one by one to each person email address.
What is happening:
- the reports are generated and exported fine - the email are sent to the right addresses but the first person receives the correct report , the second person receives the report from the first person plus its own report and so on.
Here is my code :
Private Sub MakeReportSendEmail_Click() Dim MyDB As DAO.Database Dim MyRS As DAO.Recordset Dim strSQL As String Dim strRptName As String
I have a form which uses a parameter based query to present an individual senior doctor with a list of names for of individual juniors to provide an assessment report on. When the first form opens the user enters their RespondentID.
Once senior has decided which names to comment on I have another form which has the questions to be answered which is opened by clicking a button on the first form.
How can I pass a parameter from the first form to the second so that only the records relevant to that senior doctor are displayed? The underlying table has 60 senior doctors and 20 junior doctors. The senior doctor is identified by the field RespondentID in the first form. I've tried putting a WhereClause in the FormOpen command but I still get a dialogue box asking for the parameter RespondentID when the second form is opened.
I am trying to allow end-users to only use buttons to navigate and display records in my database (so they don't know access is in the background) I have query that runs when they press a button but after they run it there is no way to get back to the main interface screen i.e. there is not a place to put another button and close the query. I was looking into creating a form to display the query results in datasheet view but it is not appearing the way I want. I inserted a subform and the results got better but I also do not like the way it displays because the user can see the subform, simple solution to get my data to display in the form so a user can view the results similar to datasheet view?
Essentially I have a table for rooms around my school and what the rooms contain. Most of the details for the rooms are Boolean (e.g. If the room has a projector, Yes/No).
So what I am trying to do is have a form where i can select a checkbox(s) and if i tick one, a query that holds all the room details will only show rooms with projectors in them, which i can then display those results in another form.
My question is how do I get the check boxes in the form to narrow down the room results to only show the ones with the criteria i have selected in the form?
I have a form that displays multiple records in datasheet view. I want to query off of that form and return all results for all records being displayed. However, I'm not sure how to tell Access to do this. Access instead wants to return records for only the first displayed record in the form or the record that is highlighted by the cursor.
In the attached image you can see a list of AccountingUnits (AU) going down. My query using AU from the form as criteria will only return records for AU 114510 since it is the first record, but I would like to see records for all AU's being displayed by the form. How can I do this?
My Form is taking its results from a parameter query, and since my subform also has the same control source (the query).
It always prompts me twice, although not a major problem it is irritating!
Is there any way that when I type the search results once the sub form takes the results from the main form?
(P.S. The form asks me for parameters even when printing and saving, is there not a way that this can be stopped too by maybe taking the results off the current page?)
Essentially I have a table for rooms around my school and what the rooms contain. Most of the details for the rooms are Boolean (e.g. If the room has a projector, Yes/No). So what im trying to do is have a form where i can select a checkbox(s) and if i tick one, a query that holds all the room details will only show rooms with projectors in them, which i can then display those results in another form.
My question is how do I get the check boxes in the form to narrow down the room results to only show the ones with the criteria i have selected in the form?
I created a search form. It has 6 unbound text boxes and 2 combo boxes in the header. Users can select values from the combo boxes and/or enter names in the other text boxes. These values all go into a filter on my Main table and the filtered results show up in the detail section. That used to work fine.
Now, I've been trying to convert the filter into a query and show the query results in the detail section instead. (Why? Because of the ever-changing business requirements, of course!)
For some reason, the detail section went blank. All white. When I change the Data Entry property to No, it fixes that.
However, the text boxes for entering the search criteria will not accept any values anymore. It's like they are disabled.
When I change Data Entry property to Yes, I can enter text into the text boxes again. But the detail section blanks out again.
I have some code in my database that will open a form based on the result of , I think, a union query.
Private Sub resultbox_DblClick(Cancel As Integer)
'Open report based on the ID from resultbox listbox
DoCmd.OpenReport "ResultsStan", acViewReport, , "[ID] = " & Me.resultbox, , acDialog 'End If End sub
What I need to do is open one of a number of reports. The report that needs to be opened depends on another value that is passed from the union query - DOCCAT
Being still a bit of a novice I tried...
'If "[DOCCAT]= " & Me.resultbox Like "Standards" Then DoCmd.OpenReport "ResultsStan", acViewReport, , "[ID] = " & Me.resultbox, , acDialog 'End If
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
I have a query (used in a combox) with a field called "UserID" and in the query I would like to have the UserID field get it's criteria from the "User" field on a hidden form.
I have it for the most part however, I have two users (myself and another) that when we use the combo box we se "All" the records in the query. I was thinking something like:
I run a physical therapy office and patients come in for treatment either 3, 4 or 5 times per week. My database is used to track these frequencies (among other things).
I have 3 queries which count how many patients come in 5, 4 and 3 times/week.
In my main table I have fields called "how many 5's", "how many 4's" and "how many 3's".
I have tried to design an update query which will update those fileds in my main table to reflect the counts in the 3 queries mentioned above.
(I'm not using SQL view, I'm using the query design view)
In the "update to:" row, I use the Build function and locate the count I'm looking for.
Problem: when I run the query I get the error: Operation must use an updateable query.
I'm trying to create a report that prints out results of a filter by form search.
I have a form, frm_account, which displays data from tbl_account.
I have a select query, qry_filter_results, which I want to take the filtered results from frm_account.
My problem is that I don't know how to take the results from the form. Is it a parameter in the query? Or is it the criteria fields? I've tried a couple things in the Expression builder for the criteria, but each has failed. I either get a report with nothing in it or a report with every record in tbl_account.
I have a query that checks an expiration date field and displays the word "Expired" in another field if applicable. This query is used to look up items, then the user would enter whether or not it is approved right in the resulting data grid thereby entering that approval into the table being used for the query. Can I do something with the query so that if the item returned has expired, a user would not be able to enter anything into the approval field? Something like, if field1 = "expired" then lock the table? I can't use a form, I have to just do it in the basic query or forget it. I would very much appreciate any suggestions!
Here's my problem. I need to generate a report that says how much of each individual product was produced and as well as the total produced for a specified category in a time period. Something like the following:
I currently have a query that queries a database and pulls out all products that were produced in a specified period and the categories they belong to and dump them into a local access table. Now what I need to do is search through the query results and count up how many of each product were produced (02 AA, 01 AB, etc...) and the totals for each category. The number of categories is pretty limited (6), but there are hundreds of product codes, so I need a way to do this without having to type in each induvidual product code as the requirement by which the query searches. Also, the product codes that get returned are different every day.
I was thinking something along the lines of take the product code of the first row and check for any others in the results that match and write that into another table. Then move onto row 2 and use its product code as a search parameter and search through the query results for any matches. Then continue that until the end of the query results. Can I do that? Is there a better way to achieve what I need?
I use the follwing code to filter a report based on the listbox selection on a form. Below is the code I use, the problem it will error if the results have an apostrophe in the string.
Private Sub FilterDesc_Click() Dim strWhere As String Dim ctl As Control Dim varItem As Variant 'make sure a selection has been made If Me.ListCarrier.ItemsSelected.Count = 0 Then MsgBox "Must select at least 1 Carrier"
I am building a form that updates a query and then generates a report based on the updated query. I am having two problems;
1. I have successfully concatenated the "First Name" and "Last Name" fields in the query to appear as First space Last, but in the actual report I get a compile error. I've tried everything I can think of with no luck. This is what it looks like in VBA:
2. I am trying to figure out how to update two labels (lblDescription and lblSecondaryDescription) on my report with the information the user types in the text boxes (txtDescription and txtSecondaryDescription) on the form. I tried calling a variable for each label and setting it equal to the corresponding text box, but I didn't think it would work and I was right.
I am trying to print a report based on the filtered results of a form where the data record source is generated from a query. What I have is five unbound comboboxes on a form that filter the results of the query on a subform which works fine in whichever combination I set, I then want the report to print out the results of the filter and the filter combination that I used - basically exactly as it appears on the form (I have used the same query / subform in the report with text boxes to show the filters used on the form). My VBA skills are quite limited (but improving!) and I have trawled the web trying different code examples but can't seem to get it nailed. Current filter code follows;
Code: Option Compare Database Option Explicit Private Sub PrntConfigReport_Click()
I have a form that users can input data into and based on that data it runs a query and generates a report. These reports can be different based on user entered data on the form. My issue is within the report I would like to sum certain fields. The problem with trying to sum theses fields is that they show up on each row so I have hidden duplicates but when trying to sum the field it still trys to count the hidden duplicates thus giving a value that is of no use.
I have tried many methods to sum but one of the problems I continue to run into when I create a text box and build an equation and reference the field I would like to sum is when the report runs it is asking for a value to be entered for the field I am attempting to sum. I shouldn't need to enter a value as I am trying to obtain the value.