Append Queries To Related ID And Its Related IDs?

Aug 30, 2006

I have a list of class sessions. To help with maintaining attendance, each session has its own roster. I just need to add a functionality so user can make sure the attendance roster is synchronized with the past sessions and future sessions in events of last minute additions/drop or updating names/contact infos. The sessions are related to themselves as below:

ClassID PreviousClassID
1 Null
2 1
3 2
4 Null
5 4

So therefore to propagate the changes into all sessions how would I instruct the query to look for each related ID then checks if it's also related...

I'm thinking I may have to use VBA to do what, but I hope that can be done with a append query.

Thanks!

View Replies


ADVERTISEMENT

Queries :: No Related Record To Be Counted As 0 (zero)

Dec 18, 2013

One to Many tables:

tbl_Doctors - Main Table : PK is doc_ID
tbl_Patients - Related Table : PK is pat_ID and 'related key' is docpat_ID

Dr. John has 3 Patients
Dr. Sam has 7 Patients
Dr. Andrew has "No Patients" IE. NULL

The (totals)Query:
Group by doc_ID (tbl_Doctors)
Count of pat_ID (tbl_Patients)

It works but ofcourse it does not include Dr. Andrew - as it shouldn't, because there is no related record in tbl_Patients.

What must the WHERE statement be to include Dr Andrews' number of Patients and display it as "0" (zero) ?

View 3 Replies View Related

Update A Table In All Related Forms And Queries

Feb 15, 2007

I have created a database for storing, query and deleting data. Now the user wants to delete a row from a table and create two new rows. In my opinion this will need lots of work in order to replace all related queries forms and reports in the form. Is there any whay to do my job more easy in modifing a table and all related items be modified by themself? I still do not have any data in the table but if I did will I loose those data?
Thanks.

View 2 Replies View Related

Queries :: Query Using Criteria From Non-related Table?

May 15, 2015

I want a query selecting records from table1 based upon a value in table2 -

table1 contains thousands of records - fields include VendorNo and VendorName

table2 contains a single record - fields include VendorSearchName (which is a "short name")

I am trying to create a query which lists all VendorNo and VendorName entries where VendorName contains VendorSearchName

eg. VendorSearchName = "Fred" will list VendorNames including "Fred Flinstone", "Big Fred" etc

View 3 Replies View Related

Queries :: Concatenating Values In Related Tables

Aug 4, 2014

I have three tables: Event related on to many with Procedure Procedure relates on a one to one basis with the description of the procedure in a table called ProcedureCodes.

I wish to have a query which outputs three columns:

Event - Prcedure1, Procedure2, etc - Description1, Description2, etc.

I have tried the Allen Browne module [URL] .... This gives me:

Event - Procedure1, Procedure2, etc using the expresion:

Expr1: ConcatRelated("[Procedure Code]","[tbl-procedures]","[tbl-procedures].[Event number]=" & [Event no]) to concatenate the procedures.

But I am struggling to get the final column! I have tried the following:

Expr2: ConcatRelated("[short description]","[tbl-procedure code]","[tbl-procedure code].[ProcedureCode]=""" & [Procedure Code] & """" And "[tbl-procedures].[Event number]=" & [Event no])

But this does not return what I want.

View 14 Replies View Related

Queries :: Include A Field Not Related Into A Query

Jul 10, 2015

How can I include a field from a table in to a query - that has no relationship?

For example...

The 'Despatch' field is in a seperate table called 'Product', because we despatch multiple products for any ONE order at different times, so it needs to be against the Product and not the full job itself.However, when I include the 'Product' table into the query and insert the 'Despatch' field into my query, and run it comes up with an error...

"The SQL Statement could not be executed because it contains ambiguouse outer joins. To force one of the joins to be performed first, create a seperate query that performs the first join and then iclude that query in your SQL statement". Here's the current SQL statement

Code:
SELECT [Materials Requested].[Job No], [Materials/Orders].Total, Jobs.[Project Name], Product.Despatch
FROM Product, Orders INNER JOIN (((Customer RIGHT JOIN Jobs ON Customer.[Customer ID] = Jobs.[Customer ID]) INNER JOIN [Materials Requested] ON Jobs.[Job No] = [Materials Requested].[Job No]) INNER JOIN [Materials/Orders] ON [Materials Requested].[Materials Requested ID] = [Materials/Orders].[Materials Requested ID]) ON Orders.[Orders ID] = [Materials/Orders].[Orders ID];

View 1 Replies View Related

Queries :: Query With 2 Names Related To Same Table

Aug 18, 2014

I have a table (tblrecords) with fields, entered by, recieved by and date and time,entered by and recieved by are both referenced in tblemployee.i want a query that will retrieve

fname, lname (of entered by from tblemployee), fname, lname (of recieved by from tbl employee) and the date and time from tblrecords)however i cant think how to do it with both names coming frm the same table?

View 9 Replies View Related

Queries :: Adding Fields In A Table That Are Related To Other Tables

May 13, 2013

I am a beginner in access and I want to populate a new field (REPUN_1 which corresponds to SEGMT_ID in the other table) in my table and this field is coming from another table. The values of the fields need to correspond to the row of my actual table (JMTable) having the same CO_ID, MOVEPLANCD and TTY_NO as the table I want to extract the values from (DI_Treaty_Crosswalk).

Here is my query:

UPDATE JMTable SET [REPUN_1] = DI_Treaty_Crosswalk.SEGMT_ID WHERE JMTable.TTY_NO = DI_Treaty_Crosswalk.TTY_NO AND JMTable.CO_ID = DI_Treaty_Crosswalk.CO_ID AND JMTable.MOVEPLANCD = DI_Treaty_Crosswalk.MOVE_PLAN_CD

and it doesn't work since access ask me to enter a parameter value.

View 1 Replies View Related

Queries :: Selecting Related Image Based On Percentage

Aug 16, 2013

I have 2 table,

Table1 has fields
docno (text)
title (text)
progress (number)

sample data is like below:

doc-001 test1 90%
doc-002 test2 25%

Table2 has fields

sample data is like below:

id (number)
icon(attachment type)

1 image1
2 image2

Now I would like to make a query when progress of each docno is equal and more than 50% it uses image1 And when progress is less than of 50% it uses image2

Doc-001 test1 90% image1
Doc-002 test2 25% image2

View 2 Replies View Related

Queries :: Concatenate Related Records Into One Expression / Field In A Form

Feb 13, 2014

In my query, I have several results that relate to the same PK overall, and I'd like to concatenate these records into one expression/one field in a form.

Currently my query looks like this;

As you can see, the BandPK/BandFK are repeated where the GenreFK/GenrePK are different. What I'd like to do is concatenate the column named Genres into one field so the BandFK/PK isn't repeated.

View 14 Replies View Related

Queries :: Creating Employee Database To Record Related Information?

May 9, 2013

i have been trying to create an employee database to record:

1. Name , Address
2. Telephone
3. Date of birth
4. employee ID#
5. Emergency contact -name, address, telephone
6. Photograph
7. Other pertinent information related to employees

So far I have incorporated the contacts database forms into my new database but I am unable to link the forms into one form that will incorporate all the information needed. Is there an existing employee database that I may edit to suit my purposes?

View 2 Replies View Related

Queries :: Mass Duplicate Main Records And Related Subform Records

May 29, 2014

In my simple database (attached), I need to mass duplicate Tasks and their Notes.

I have three tables: tbTasks (PK: Task_ID), tbNotes (PK: Note_ID), jtbTaskNotes (FKs: Task_ID and Note_ID). jtbTaskNotes is my many-to-many junction table that ties Tasks to Notes.

The main form (fmTasks), bound to tbTasks, has a subform (sbfm_TaskNotes) that displays notes associated with each Task. On themain form,you select which Tasks you want duplicated via a checkbox. The append query (quCopyTasks) will duplicate all tasks that have the checkbox checked. All good there. However, I can't figure out how to also duplicate each task's Notes.

I found Allen Browne's solution [URL] ....., but that only handles duplication of one record at a time, whereas I need to duplicate many records at a time (sometimes 10+ records). How do I go about duplicating multiple Tasks and their associated Notes?

Before you ask "why are you duplicating records?": There are times when tasks need to be re-accomplished and therefore need to have a new record. It's easier to duplicate records than it is to hand-jam everything again.

View 5 Replies View Related

Related Value

May 24, 2006

Hey guys, new to access and from what I used to use it was simple seems a little more hidden or done differently in access. Its basic, all I am trying to do is match field value from products and another field value from mounts table and if they match on a new record creation in the products table then it auto fills in data on a third field coming from the mounts table. Seems like a simple relationship I come from using filemaker so I would just relate the two tables and if they matched on a new record it would auto fill in the value from any field that was related was point and click specify get value from there.. Figured it would work something similar, maybe im missing something.. Anyone answer this, im sure its an easy one.

View 2 Replies View Related

Related Records

Aug 28, 2007

I've been using an access d/b for ages, it's one of the template (Orders) databases included with access but modded to suit my own use. copy attached with customer details removed.

Last time I used it it worked fine but yesterday, when I tried entering order information, I get an error saying cant add or change a record because a related record is required in table orders.

Can anyone shed some light on the potential problem? Bear in mind I'm not an advanced user and have very limited knowledge on relationships in access.

Thanks in advance.

Marc

View 4 Replies View Related

First/Last Of Related Records

Oct 13, 2005

The "last" total in an Access query is unpredictiable. I have a Journal, with the main form/dataset being linked to the entries of that day. I would expect the 'last' total word to give me the last entry of that day, ie. what I ate for supper. But in the two qrys shown, it does the opposite. What is the most relable way to get the last entry of that day (ie. the one with the highest journalID)? :confused:

Sample Database attached.

View 7 Replies View Related

Min Value And Related Records

Oct 29, 2005

Hi,

i need a query to return the first orderdetailsID and related productsID, so that all the other products that are the same as oldest order can be manufactured together.
In access help menu it shows it would be something like using the criteria under productname1 field:
(SELECT [productname1] FROM [the next one to cut query] WHERE min([orderdetailsID]))
But this returns an error cannot have aggregate function in where clause
min([oderdetailsID])).

I've also tried with 2 queries, 1 with the min function and the using inner join, but can't get it to work.

Thankyou

View 4 Replies View Related

Related Records

Jan 18, 2006

Before I spend an age trying to get this to work I thought I'd consult some experts.

I have a main data table for recording all possible insurance claims against a company. What I want to do is create say 2 incidents but link them in some way. i.e. One of our drivers had a car accident (1 claim against our motor policy), but then the driver of the other car sues us(1 claim against our public liability).

I can create 2 seperate records and maybe have a field to highlight parent/child reference numbers, but is there anyway I could allow the user to click a button and see the related records simultaneously?

Cheers

View 2 Replies View Related

Help With Related Forms

Sep 6, 2006

I have a form (data entry setting-yes) with several tab control-grouped forms. All the forms/underlying tables are linked by a field called ID. When I enter data in the main form, related records are only created in the tables for the subforms if data is actually typed into them as well. How do I force the tables to enter a record in the subforms' table, when only entering data in the main form even if the only field with data is the ID??

View 1 Replies View Related

Help Find Related Records.

Apr 27, 2005

Hi
I'm have created a video database with a genre field. Is there a way that when i click a button a list is displayed of all the records which are the same genre?
Thanks
Aden

View 1 Replies View Related

Date Related Problem

May 31, 2005

I have a date related problem. I have an IF statement, that verifyes if a certain date entered in a table is <=Now(). The problem is, that it's vorking great just for curent year, curent month. For example: today is 31.05.2005 and if the value in my table is 13.06.2005 than for the <=Now() testing, it's telling me that 13.06.2005<31.05.2005. Why? Please help!!!!!!!!!!!!

Thanks,
Attila

View 4 Replies View Related

Updating Related Tables

May 15, 2006

Hi everyone!

My names james, im 18 and im a data manager for a school.

My schools database stores student data such as names, classes and exam grades. I have a table containing each students personal details such as name and address. Each pupil is assigned a unique PupilID which is the primary key. I then have a number of other tables linked to it with one to many relationships. Each of these tables holds a different set of exam results. The tables are linked through PupilID. The primary keys for the other tables are auto numbers.

The problem is this: when i add a new student to the Students table i cannot get their PupilID to automatically be entered into the other tables containing grades as part of a new field. How can i make this happen?

Thanks.

View 9 Replies View Related

Table Related To A Field

Nov 21, 2006

Hello

Could you help me ?

My problem is :

I'm developing a ms database for the a "repair service" .

I created a table witch contains basic data from customer, including its unique ID number (key field), name and contacts ...

Now I need to store the "repair service" data from each costumer ( its time consumption, replaced materials...) in a separate table but, If I'm thinking well, I must have a table for each costumer so, I will need to link each individual "repair service" data table from each costumer to each costumer itself.

Do you know how to do this ?

Lots of thanks in advance,

Miguel

View 4 Replies View Related

Relationship Related Issue

Dec 18, 2006

Hello!I've one issue with relationships.Ok, first of all I got two tables "Persons" & "Vehicles" and there's primary key on both of tables called "Person_ID" and "Vehicle_ID". There's also "Person_Vehicle_ID" field in "Persons" table and "Vehicle_Person_ID" in "Vehicles" table. Rowsourcetype is set to "Table/Query" and rowsource is set to "Person_Vehicle_ID" to "Vehicle_ID" and "Vehicle_Person_ID" to "Person_ID".Ok, here's so called issue what I've noticed. I need to create somekind of dynamic connection between these two fields on different tables. Let me explain, when I change "Person_Vehicle_ID" value to 2, value in other field "Vehicle_Person_ID" would change too to equal that persons ID. So, if "Person_ID" value is 1 and "Person_Vehicle_ID" is set to 2, then that record "Vehicle_Person_ID" would be 1, where "Vehicle_ID" value is 2.(Hope you did understand me and sorry about my crap english grammar.)How would you build this kind of feature?Feel free to ask further questions, also waiting replies asap. :)

View 10 Replies View Related

Updating Related Tables.

Jan 22, 2007

Ok due to user error (and my own fault for not archiving an old database) we now have two databases which have had data entered into with the same table structure.

The table structure we have at the moment is with the related field in []:

Propertytbl[Propertycode] is related to Systemtbl[sysID] which is related to Assessmenttbl.

There is also another Temperaturetbl linked to Systemtbl by [sysID]

The problem i have is sysID is an autonumber. I can't simply paste in the difference in data as the assessmenttbl records and Temperaturetbl records will point to a different system (as the sysID will change in the Systemtbl data)

Can anyone think how i can do this either through using queries or programmatically so that i don't have to enter 5000 records manually.

I've tried using append queries but this produces the same affect as above.

Many thanks

Matt Collins

View 1 Replies View Related

Updating From Related Tables

Apr 2, 2007

I have a combo box in my main form that gets its list of physician names from tblPhysician. When the physician is chosen and the record saved, it saves the PhysicianID to my main table, tblOncReg.

When I delete a physician, any record that had that name chosen continues to have that name in the record despite it being deleted from tblPhysician.

I thought that setting relationships would solve it, but when I select "Enforce Referential Integrity" and "Cascade Update Related Fields", I get an error saying "Invalid field definition 'ID' in definition of index or relationship.", and it doesn't set the relationship.

Would setting the relationship solve that problem?

View 4 Replies View Related

Updating A Related Table

Jun 26, 2007

I have two databases, one containing the tables and one containing the forms and queries. The forms/query database is built from linked tables from the tables database. I would like to expand one of the fields from 7 characters to 9 characters. I planned on doing the in the table database, then updating the linked table. However, the table I need to alter has relationships with about 10 other tables and I get the (you cannot make changes to a related table error message). Is there a way I can make this change without deleting all the relationships?

For future reference, should the relationships have been created in the form/query database?

Thanks, N

View 3 Replies View Related







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