General :: Parameter Query / Report With Related Tables

Jun 13, 2013

I have a parameter query for looking up a specific lot number in my database. The lot number table has 4 related material tables that deal with material issued, reworked, and rejected for that lot number. They lot number table is in a one to many relationship with the related tables.

I have a report based on this parameter query with 4 subreports. I want the report to display the lot number data and sub reports to display the related data in the material tables (all linked by the lot number defined in the parameter)

View Replies


ADVERTISEMENT

Modules & VBA :: Email Detailed Report By Looping Through Related Tables

Dec 9, 2013

I want to automate the distribution of individuals Vacation Balance and Usage via email. The data is being pulled from 2 tables related by an Employee ID#. tbl-Employees provides the Header Info for each employee and tbl-VacLog provides the detailed Usage data.

I want the output to appear as follows in the body of the email:

Name Start Date Vac. Bal TotVacToEOY Personal Bal.
John Doe 1/1/99 120 160 8

Usage Date Hours Reason Code
1/1/13 8 V
2/15/13 12 V
3/6/13 8 V

I've got a handle on creating the email and sending but where I'm having trouble is in making the link between the two tables with the Employee ID# and printing the corresponding detail data with Parent Record.

Code below...

Option Compare Database
Sub SendMails()
Dim DB As Database
Dim RecordSetA As DAO.Recordset
Dim RecordSetB As DAO.Recordset
Dim TotalRecordsA As Integer

[Code] .....

View 1 Replies View Related

AND Query, Across Related Tables

Jan 12, 2007

Hello, I apologize in advance if there have been lots of questions like this, but the search won't let me use AND as a search term!

I have two related 1 to many tables. The parent table contains clients, and the child table contains categories, each client can have many categories. (i originally intended to have the categories be columns in the client table, in which case what i want to do is easy, however, then it becomes a nightmare when the user wants to add a new category hence the related situation described.)

Is there an easy way to find all the clients who have both category 7 and category 10? I can do it writing a query to find all the 7s, then another to find all the 10s, and a third to find those which have both. I am hoping there is an easier way, as i need to give the user a way to search via categories in whatever combination they fancy. The OR's i can do easily it's the AND's that are causing the problem.

The only idea i have at the moment is to make a temp table with the the clientid, and a long field holding each of the category ids, seperated by commas, and then searching using like "*7*" and like "*10*".

Does anyone have any better ideas, i'm hoping i'm missing something really obvious......

Thanks, Anna

View 1 Replies View Related

Query Doesn't Affect Report... Related Problem

Nov 13, 2004

I've encountered a simple problem. =) I have a report based on a query. Of course due to the relations the query table should affect the report. But it does only with the filter parameters I put in the Query Design View, the quick ones ("filter by selection", etc.) that are in the result table view work there but doesn't affect the report. Still the query asks me to save it each time I apply any of these quick filters but make no changes at the end.

Any ideas how to make them work in the report? Or these filters are temporal and shouldn't work in that way? If so, what could I do to simplify customer's life?

(Access 2003, Access2000 based database)

View 2 Replies View Related

Lookup Query For Related Tables

Sep 9, 2005

I have a table of 'things' and two related tables, type and subtype. Each thing has a type and a subtype. The types table contains simply Index (autonumber) and Type (text). The Subtype table Index (autonumber), type (number) and subtype (text), where index and type form the primary key and type is a foreign key to the types table. Thus each type has its own sub-set of subtypes.
In the design of the Things table I have set the lookup for Type and Subtype to be a dropdown, but of course the subtype drop-down shows all subtypes, not just valid ones. If I select a subtype that is incorrect for the selected type then of course I get an error, but it would be nice to set the query in the subtype lookup's Row Source to just display the valid subtypes. At the moment it just says "SELECT index, type FROM subtype" How do I put in a WHERE clause that references the Type field for the current row: "SELECT index, type FROM subtype WHERE type=<type selected in current row>"?

View 3 Replies View Related

Date Related Query Across Tables

Jun 13, 2006

Hi, Ive got another query I need to do which I just dont know where to start from.
I have two tables, membersdata and bankdata. These tables are linked in a relationship thou the field 'description' in both tables.
What I want to do is be able to input a date and have the fields I require from both tables displayed. the dates are stored in the bankdetail table. I have made a query that allows me to input the dates in the bankdata table and that works but I need the membersdata to be shown on this query also.

How can I get the query to show up all the data i requre from both tables?

This query will give me the information of people that have paid us in the dates selected. I also need to revese trhe query so it shows the people who have not paid. so Im basically showing the records with a null value in the description field.

This ones totally caved in my brain this time of the morning! Any help would be fantastic!

Cheers
Phill

View 1 Replies View Related

Related Tables Query Question

Jan 24, 2007

i have 2 tables set up with a one-to-many relationship; one table has demographic information for patients, and the second has test results for each patient. is there any way to make a query that will give me the date of the last test result for each patient?

in other words, i want to query the MAX(date), but for each individual patient ID.

Thanks in advance.

View 1 Replies View Related

General :: Stored Procedure And Parameter Pass Via Form To Generate Report

Jan 28, 2015

I have a stored procedure created in SQL SERVER 2008r2

I have a form in access adp project with combo boxes, when I click the submit button I want the values chosen to be the parameters and the stored procedure called to generate a report

Is this possible .

View 1 Replies View Related

Queries :: Report Value As Parameter In Query

Oct 24, 2013

can i set a value in report as parameter in query

View 1 Replies View Related

Automatically Return Parameter Query As A Report

Mar 14, 2006

I created a combo box that runs a parameter query based on the name entered in the box.

Is there some way to return the results as a report instead of in datasheet view?

I'm wondering if inserting some sort of code into the event procedure of the "OK" button (which launches the query) would work.

Would greatly appreciate help---

View 4 Replies View Related

Queries :: Use Value From Parameter Query In Report Header

Jul 12, 2014

I have a query that I use to populate a report.

The query has a parameter box that opens and asks the user to enter a date.

I would like to display this date in the Report heading.

Is there any way that I can grab the value entered into the parameter query and display it on my report heading?

View 1 Replies View Related

Display Value Of Parameter Query In Report Title

Nov 21, 2011

I would like to display the value of my parameter query into the title of the report.How could I do this on Access 2007?So far I have made another field in the query and called it ParaDate: [JobDate]

Then in the report title I wrote:

=Limousines booked for&" "&[JobDate]

But it's not working.

View 1 Replies View Related

Query / Report Parameter Prompt Functionality

Jan 4, 2013

I have a couple of questions which are sort of related. They both revolve around Parameters with a Query/Report.

Here is a bit of background. The source Table is formatted in a way similar to this:

Code--Account#--Expense Description--Jan--Feb...

When running the Query, and associated Report, the user is prompted to input an Account# via a Parameter that I set up. The dialog box pops up with the word "Account#" and a box for the user to enter by what account that they want to restrict the Report. [Question 1] - Is there a way to make this dialog box contain a drop-down box with a list of predetermined accounts instead of the aforementioned entering of an account number? If not via this dialog box, is there another way?

Also, multiple accounts roll up into a single P&L line item. For example, let's say that accounts 1234 and 5678 both make up "Equipment". [Question 2] - Is there a way to run the Report in such a way to return all accounts which roll into a line item? I want to have the ability to run by either an individual account or the P&L line in total.

View 14 Replies View Related

To Display Parameter Query Criteria On Report Even For Nil Results?

Nov 10, 2005

Hi,

Need advise on how to display on my report the criteria that i had specified in the parameter query even if the result is nil.

How can this be done??

Thanks!

View 5 Replies View Related

Parameter (Date) Query To Get Input Dates On Report?

Apr 28, 2006

I have a report that has an underlying query that asks for Start Date and End Date.

Is there anyway that I can get what the user inputs into the box to be put into the Page header of the report?

ie: user enters into the parameters
[Start Date] 01/01/2006
[End Date] 04/04/2006

Then when the report displays it says

Report for the period 01/01/2006 to 04/04/2006

Thank you for your time

View 4 Replies View Related

Modules & VBA :: Export A Report Based On Query Which Has Parameter?

Sep 22, 2014

I'm trying to export a report based on a query which has a parameter.

this parameter has to come from the recordset.

now if i run the procedure it asks me for the parameter.

How do i get it to take the parameter from the recordset?

it should take the column 'Company#' from the recordset

here is what i have now:

Public Function mOutstandingInvoices2()
On Error GoTo mOutstandingInvoices2_Err
Dim rst As Recordset
DoCmd.SetWarnings False
'On Error GoTo BREAKOUT

[code]....

View 10 Replies View Related

General :: Query / Text / Form Parameter Value

Jun 28, 2012

The items in my database:

Form - Customer_Data
Form - ConsignmentGuide
Query - Customer_Data Query
Text Field - GBL
Text Field - Text89

Text89 is using an Expr from query
Expr6: Left([GBL],4)

What happens is Expr6 will take the first 4 Letters of GBL. I want to double click GBL an bring up the ConsignmentGuide based on Text89.

Code:
DoCmd.OpenForm "ConsignmentGuide", , , "Text89='" & Me.Expr6 & "'"

My problem is when I do this I get a pop up asking for a Parameter Value. but there is text in Text89. How to I get a round the Parameter Value box coming up an automatically do this. If I type the first four letters in to the Parameter Value it finds it on Consignment Guide.

View 6 Replies View Related

General :: Putting Query Parameter Requests On A Form

Oct 20, 2014

I want to build a form that allows a user to book an appointment.

I want them to be able to see a choice of their own or other people's appointments for the day so they can choose a time.

I'm told i can build a query to show the appointments and put that in a subform on the form.

My question is this: to select which person's appointment to display and which day, i need to give the query parameters. I don't really want to do it with the parameter query popups. What i'd like is a couple of pull down lists at the top of the timetable to select and display the person and date.

Is this possible? Should i put the pull down boxes on the form or in the query?

(I'm using a2007)

View 6 Replies View Related

Tables :: Developing Related Multi Level Child Parent Tables?

Jan 14, 2013

I have created a table that acts as a header for my data and a second table that acts as line item data. What I need to do now is add a second child table that uses the line item data as its parent table and stores associated line items for each record. Is this possible?

This is a skeleton view of what I'm going for:

Master Table:

tlbAuditReportHeader
- AuditDate
- AuditArea
- Auditor

Sub Table:

tblDiscrepancy
- Discrepancy
- CorrectiveAction
- ActualCompletionDate
- VerifiedDate
- Notes

Sub table to Sub Table

tblFollowUp
- FollowUpDate
- AssignedTo
- SpokeWith
- EstimatedCompletionDate
- Notes

Sometimes tasks change hands or are pushed back depending on work load. It would be nice to be able to track something like this.

View 1 Replies View Related

Moving Data From 2 Related Tables To 2 New Tables As An Archive

Apr 3, 2007

I have a form displaying the 11 fields of the parent/primary table using a selection from a combo box. I am using queries and vba code modules respective to form, combo box and command buttons. I have initial code that uses the two fields from the combo box selection to append same to a new parent/primary archive table. I now want to add to the append SQL the remaining fields to the parent/primary archive table. When I add the second sql string for the remaining fields to the same procedure and execute I keep getting 'null in primary key'. If I copy the primary record and paste same into the archive table it works.

Private Sub Command26_Click()
On Error GoTo Err_Archive_Primary_Click

Dim strSQL As String
Dim strSQL2 As String

strSQL = "INSERT INTO ARC_289325045 ([Survey Point ID], [Survey Area Detail], [Date On Site]) " & _
"VALUES ('" & Me.cboAreaDetailDate.Column(0) & "','" & Me.cboAreaDetailDate.Column(1) & "'," & _
"#" & Me.cboAreaDetailDate.Column(2) & "#)"

CurrentDb.Execute strSQL, dbFailOnError

'strSQL2 = "INSERT INTO ARC_289325045 (RecordID, UnitID, UserName, [TimeStamp], [Survey Point - Area], Measurement, NewArea, [EXIT Form] ) " & _
'"SELECT FORM_ID_289325045.RecordID, FORM_ID_289325045.UnitID, FORM_ID_289325045.UserName, FORM_ID_289325045.TimeStamp, FORM_ID_289325045.[Survey Point - Area], FORM_ID_289325045.Measurement, FORM_ID_289325045.NewArea, FORM_ID_289325045.[EXIT Form] " & _
'"FROM FORM_ID_289325045"

'CurrentDb.Execute strSQL2, dbFailOnError



Exit_Archive_Primary_Click:
Exit Sub

Err_Archive_Primary_Click:
MsgBox Err.Description
Resume Exit_Archive_Primary_Click

End Sub


The next step is to do the same for the child table and append related records to the child archive table.

View 4 Replies View Related

Moving Data From 2 Related Tables To 2 New Tables As An Archive

Apr 3, 2007

I have a form displaying the 11 fields of the parent/primary table using a selection from a combo box. I am using queries and vba code modules respective to form, combo box and command buttons. I have initial code that uses the two fields from the combo box selection to append same to a new parent/primary archive table. I now want to add to the append SQL the remaining fields to the parent/primary archive table. When I add the second sql string for the remaining fields to the same procedure and execute I keep getting 'null in primary key'. If I copy the primary record and paste same into the archive table it works.

Private Sub Command26_Click()
On Error GoTo Err_Archive_Primary_Click

Dim strSQL As String
Dim strSQL2 As String

strSQL = "INSERT INTO ARC_289325045 ([Survey Point ID], [Survey Area Detail], [Date On Site]) " & _
"VALUES ('" & Me.cboAreaDetailDate.Column(0) & "','" & Me.cboAreaDetailDate.Column(1) & "'," & _
"#" & Me.cboAreaDetailDate.Column(2) & "#)"

CurrentDb.Execute strSQL, dbFailOnError

'strSQL2 = "INSERT INTO ARC_289325045 (RecordID, UnitID, UserName, [TimeStamp], [Survey Point - Area], Measurement, NewArea, [EXIT Form] ) " & _
'"SELECT FORM_ID_289325045.RecordID, FORM_ID_289325045.UnitID, FORM_ID_289325045.UserName, FORM_ID_289325045.TimeStamp, FORM_ID_289325045.[Survey Point - Area], FORM_ID_289325045.Measurement, FORM_ID_289325045.NewArea, FORM_ID_289325045.[EXIT Form] " & _
'"FROM FORM_ID_289325045"

'CurrentDb.Execute strSQL2, dbFailOnError



Exit_Archive_Primary_Click:
Exit Sub

Err_Archive_Primary_Click:
MsgBox Err.Description
Resume Exit_Archive_Primary_Click

End Sub


The next step is to do the same for the child table and append related records to the child archive table.
Edit/Delete Message Reply With Quote Quick reply to this message
JJKramer
View Public Profile
Send a private message to JJKramer
Find all posts by JJKramer
Add JJKramer to Your Buddy List
Sponsored Links

View 1 Replies View Related

Tables :: Splitting One Table Into 3 Related Tables

Jul 16, 2014

I'm trying to split a table up because I now realize it won't be able to do what I need in the future. It wasn't designed properly at the outset, and I'm trying to correct it now.

This is a database of pregnancies and deliveries.

The single table does not cater well for multiple pregnancies (twins, triplets, etc), and also I foresee problems when mothers come back in future for another delivery.

Therefore I am trying to separate data into 3 tables: Mother, Delivery and Baby.

This is because each mother can deliver more than once, and each delivery can have more than one baby.

I have set up a trial database, with just a few fields in each table to see if this works. An screenshot of the table relationships is attached.

The primary key of the Mother table is linked to the Delivery table, and ditto the primary key of the Delivery table and the Baby table.

I'm not sure how to migrate the data over, in terms of the primary keys of each table, because in the new tables, these should be an AutoNumber field, so that they are unique numbers.

View 14 Replies View Related

Tables :: Update Data In Related Tables?

Oct 22, 2014

I have to make a Costing System but for that I need to enter our Expense details in database according to Fiscal year and months.

I need a table for Fixed expenses and one for Variable Expenses and then I need one or more Forms to update data in those tables. Now I've created a table with Fixed Expenses. I have to update Year and Amount in that. Now it is only letting me one entry per Expense.

I want multiple entries for one Expense say 'Advertising' for different years. I'm thinking may be I need to make more than one Table, may be one for Expenses with ExpenseID and other for Years with Year and YearID and the third one for Amount with columns Amount, Method of Payment, Date and Notes. I did tried this but I think I'm not creating proper relation may be because its only updating for one year.

I'm using Access 2003.

View 2 Replies View Related

Tables :: How To Deal With Exception To Related Tables

Aug 27, 2013

I am having an issue where a small percentage of my records do not follow my related Tables.

ex: 3 tables
tblEmployee
-intEmployeeID
-intWorkCenterID

tblWorkcenter
-intWorkCenterID

tblManager
-intManagerID
-intEmployeeID
-intWorkCenterID

where:
tblemployee.intworkcenterID -- tblworkcenter.intWorkcenterID -- tblManager.intWorkCenterID

Basically I have my general employee information in the tblemployee table, the workcenter information in the tblworkcenter, and the manager of the Workcenter in the tblManager. This is correct for 99% of the employee population. however, there are a few employees whose manager isn't the 'general' manager for the employees assigned workcenter.

How I can adjust an individual employees manager, while maintaining my structure? or would i have to go back and add the managers ID to a field in the tblEmployee Table?

View 7 Replies View Related

Tables :: Saving Data To Related Tables?

Sep 27, 2012

I have a built a database to record and collate info about clinical trials that are run within my department. I have one large table [Trial Info] which contains all trial info and have created a second and third table [Milestones] & [Comments] to collect dates of various milestones and a notes that occur throughout the course of a study.

The milestones (dates) are recorded in the 2nd table and the comments are recorded in the 3rd table.

All data is entered by staff on forms. The first form captures basic info about the study, once this has been entered, the idea is to click a button to open the second form to document the trial milestones, this form also contains a subform for listing any free text comments required during the life of the study which are stored in the 3rd table.

I have setup the relationships between tables as best I can.

The main table with basic trial info is the parent table, linking the primary key to the foreign key in the second table, the foreign key of the third table is related to the primary key in the second table so these tables should be looking up the correct clinical trial as far as I can tell.

The form containing data from the main table has a button which I have set to open the Milestones & Comments form, and I have set this to open to the record that relates to the record in view in the primary form. The primary key is related to the foreign look-up key in the milestones table.

This opens the form fine, however this is not updating the foreign look-up key, this remains '0' which I assume is the cause of the following error when I try to save changes to the record

Quote:

You cannot add or change a record because a related record is require in table 'Trial Info'

How do I trigger the foreign key to update to the primary key so that the first time a milestone page is opened for a new study it creates a matching record?

View 4 Replies View Related

Tables :: New Row To Two Related Tables With One Form

Aug 6, 2013

So I have a form, it has a few fields from a related table in it, related by the name. I click 'new' on the form, but when I click save Access complains about the related table does not have a matching record. How do I have it create a new record?

View 2 Replies View Related







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