473,406 Members | 2,336 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Change a value in one table depending on the value(s) in another table

Rex
Hi,

I want to change a value in one table depending on the value(s) in
another table. I am trying to achieve this in a form.

to elaborate

I have a many-to-many relationship between tables Forms and Family and
the associate table is called Forms_Family. Forms_Family have fields
"dateSent" and "dateReceived". The Family table has a field called
"familyStatus". I want to change the value of "familyStatus" field
depending on the kind of form that has been sent and when it was
received back:

Forms_Family Table
FamilyID | FormsID | dateSent | dateReceived
------------------------------------------------------------------------
000 | form1 | 1/8/2003 |
001 | form2 | 5/9/2003 |

in the above table when I receive form1 and as soon as I enter a date
in "dateReceived" field I want the status of that particular family to
change in the Family table

Any help would be greatly appreciated..

Rex

Jan 23 '07 #1
5 2953
Rex,

I figure somebody else will probably ask this question too before
suggesting something;

How will the value in the dat field determine the status?

eg are all dates in december going to give one status and all dates in
january going to give another status etc
or
are all dates within the last 30 days going to give one status and all
dates between 30 and 60 days going to give another status etc
or
do you want one status if one set of forms has been sent, and another
status if the forms have been recieved etc

The answer to this question will determine the best way to get the
result you want. It may be you need a query on a table with a function
to calculate the status based on a date, or it may be you need a table
with dates and status defined or it may be something else - so more
info would be great!
Rex wrote:
Hi,

I want to change a value in one table depending on the value(s) in
another table. I am trying to achieve this in a form.

to elaborate

I have a many-to-many relationship between tables Forms and Family and
the associate table is called Forms_Family. Forms_Family have fields
"dateSent" and "dateReceived". The Family table has a field called
"familyStatus". I want to change the value of "familyStatus" field
depending on the kind of form that has been sent and when it was
received back:

Forms_Family Table
FamilyID | FormsID | dateSent | dateReceived
------------------------------------------------------------------------
000 | form1 | 1/8/2003 |
001 | form2 | 5/9/2003 |

in the above table when I receive form1 and as soon as I enter a date
in "dateReceived" field I want the status of that particular family to
change in the Family table

Any help would be greatly appreciated..

Rex
Jan 23 '07 #2
If the status of a family can be determined from a logical evaluation
of the data in forms_family table then you don't need to store that
information in a table. You can use a query find that information at
any time.

And then this is where Keri's statement comes into play. How does this
information affect the status? Do you have a list of 500 different
stati or is there only 5 or 6 different stati?

Cheers,
Jason Lepack

keri wrote:
Rex,

I figure somebody else will probably ask this question too before
suggesting something;

How will the value in the dat field determine the status?

eg are all dates in december going to give one status and all dates in
january going to give another status etc
or
are all dates within the last 30 days going to give one status and all
dates between 30 and 60 days going to give another status etc
or
do you want one status if one set of forms has been sent, and another
status if the forms have been recieved etc

The answer to this question will determine the best way to get the
result you want. It may be you need a query on a table with a function
to calculate the status based on a date, or it may be you need a table
with dates and status defined or it may be something else - so more
info would be great!
Rex wrote:
Hi,

I want to change a value in one table depending on the value(s) in
another table. I am trying to achieve this in a form.

to elaborate

I have a many-to-many relationship between tables Forms and Family and
the associate table is called Forms_Family. Forms_Family have fields
"dateSent" and "dateReceived". The Family table has a field called
"familyStatus". I want to change the value of "familyStatus" field
depending on the kind of form that has been sent and when it was
received back:

Forms_Family Table
FamilyID | FormsID | dateSent | dateReceived
------------------------------------------------------------------------
000 | form1 | 1/8/2003 |
001 | form2 | 5/9/2003 |

in the above table when I receive form1 and as soon as I enter a date
in "dateReceived" field I want the status of that particular family to
change in the Family table

Any help would be greatly appreciated..

Rex
Jan 23 '07 #3
Rex
It does not matter when I receive the form. The requirement is as soon
as I enter a date in the "dateReceived" field.. it should check for a
particular form (say form1) and should also check that the "dateSent"
is not NULL.. if this condition is met the status of that particular
family should change..

Thanks
Rex

On Jan 24, 2:02 am, "keri" <keri.dow...@diageo.comwrote:
Rex,

I figure somebody else will probably ask this question too before
suggesting something;

How will the value in the dat field determine the status?

eg are all dates in december going to give one status and all dates in
january going to give another status etc
or
are all dates within the last 30 days going to give one status and all
dates between 30 and 60 days going to give another status etc
or
do you want one status if one set of forms has been sent, and another
status if the forms have been recieved etc

The answer to this question will determine the best way to get the
result you want. It may be you need a query on a table with a function
to calculate the status based on a date, or it may be you need a table
with dates and status defined or it may be something else - so more
info would be great!

Rex wrote:
Hi,
I want to change a value in one table depending on the value(s) in
another table. I am trying to achieve this in a form.
to elaborate
I have a many-to-many relationship between tables Forms and Family and
the associate table is called Forms_Family. Forms_Family have fields
"dateSent" and "dateReceived". The Family table has a field called
"familyStatus". I want to change the value of "familyStatus" field
depending on the kind of form that has been sent and when it was
received back:
Forms_Family Table
FamilyID | FormsID | dateSent | dateReceived
------------------------------------------------------------------------
000 | form1 | 1/8/2003 |
001 | form2 | 5/9/2003 |
in the above table when I receive form1 and as soon as I enter a date
in "dateReceived" field I want the status of that particular family to
change in the Family table
Any help would be greatly appreciated..
Rex- Hide quoted text -- Show quoted text -
Jan 23 '07 #4
Rex
I only have four status.. namely "Approached","Enrolled","Declined",
and "Removed"

cheers

On Jan 24, 3:19 am, "Jason Lepack" <jlep...@gmail.comwrote:
If the status of a family can be determined from a logical evaluation
of the data in forms_family table then you don't need to store that
information in a table. You can use a query find that information at
any time.

And then this is where Keri's statement comes into play. How does this
information affect the status? Do you have a list of 500 different
stati or is there only 5 or 6 different stati?

Cheers,
Jason Lepack

keri wrote:
Rex,
I figure somebody else will probably ask this question too before
suggesting something;
How will the value in the dat field determine the status?
eg are all dates in december going to give one status and all dates in
january going to give another status etc
or
are all dates within the last 30 days going to give one status and all
dates between 30 and 60 days going to give another status etc
or
do you want one status if one set of forms has been sent, and another
status if the forms have been recieved etc
The answer to this question will determine the best way to get the
result you want. It may be you need a query on a table with a function
to calculate the status based on a date, or it may be you need a table
with dates and status defined or it may be something else - so more
info would be great!
Rex wrote:
Hi,
I want to change a value in one table depending on the value(s) in
another table. I am trying to achieve this in a form.
to elaborate
I have a many-to-many relationship between tables Forms and Family and
the associate table is called Forms_Family. Forms_Family have fields
"dateSent" and "dateReceived". The Family table has a field called
"familyStatus". I want to change the value of "familyStatus" field
depending on the kind of form that has been sent and when it was
received back:
Forms_Family Table
FamilyID | FormsID | dateSent | dateReceived
------------------------------------------------------------------------
000 | form1 | 1/8/2003 |
001 | form2 | 5/9/2003 |
in the above table when I receive form1 and as soon as I enter a date
in "dateReceived" field I want the status of that particular family to
change in the Family table
Any help would be greatly appreciated..
Rex- Hide quoted text -- Show quoted text -
Jan 23 '07 #5
Here's what I think you are going to need to do provided I understand
you correctly. (I am confusing myself because you have a table named
Forms.....)

I think you are telling me that you are entering a date (recieved) on a
form. When you have a date in this field (presumably date recieved) in
your table you want the status to change. I am not so sure why you feel
it needs to search for a form - if this is needed then the solution
below won't help. If you could make this clearer it would be helpful.

However your solution will probably involve creating a query based on
the table that includes the date received field (and whatever other
fields the status is dependant on). Then you can create an expression
in your query to establish the status, eg

Status: IIf([Datercvd] Is Null,"Form sent","Form Recieved")

This would check if the field Datercvd is null. If it isn't the status
field will show "Form Received", if it is null then it will show "Form
Sent".

Another slightly more complex query;
Status: IIf([Datercvd] Is Not Null And [datesent] Is Not Null,"Form
Received",IIf([datercvd] Is Not Null And [datesent] Is Null,"Form
received but no sent date",IIf([datercvd] Is Null And [datesent] Is Not
Null,"Form sent","other status")))

So - if there is a date in the datercvd and datesent fields the status
is "Form Received"
if there is a date in datercvd but no date in date sent the status is
"Form received but no sent date"
If there is a date in datesent but no date in datercvd then the status
is "Form Sent"
If it is something other than this the status is "Other Status"

Obviously this is just to give you an idea of what can be done.
(Apologies for a messy query but I am in a rush!)

Jan 24 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: PT | last post by:
I got a problem. And thats..... First of all, I got these three tables. ------------------- ------------------ ---------------------- tblPerson tblPersonSoftware ...
0
by: Chris Nighswonger | last post by:
------=_NextPart_000_0013_01C352C0.6B0A6E30 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi All, Is it possible in MySQL to use UPDATE to update...
3
by: William Case | last post by:
I cannot believe I'm having this much trouble doing such a simple thing! I have two tables with identical structure. I can use an A2K select query to show the records in table 1 that match...
0
by: EKL | last post by:
Hi, I'm making a sort of Customer and Orders database in MS Access 2003. My problem is that I wish to update the table "tblTransaction" based on changes made in the table "tblOrderDetails"....
2
by: Mark Goldin | last post by:
I have a table that is inside of a cell of another table. It seems that I cannot adjust the height of that cell. I have an extra space underneath of the internal table. ----------------------...
2
by: Prabu Subroto | last post by:
Dear my friends... I created a table (named : sven1). I want to populate this table with the record from another table (named : appoinment). but I don't know how to formulate the sql query. ...
1
by: Beeker | last post by:
I have a table called 'RawData' that collects production data. We run a report on this data everyday to see the performance of each employee. I have another table called 'tblStandards' with...
0
by: acesfull | last post by:
Hi, I am trying to do something in SQL that I have done in PHP, but I am trying to have the operation performed as a stored procedure because of the sheer number of inserts I have to perform in PHP. ...
2
by: Hillwalker | last post by:
Hi Raw recruit, no VB knowledge but some general programming experience..... Access 2000 on XP In form view, I wish to fill the field (ONLY on the record being viewed) with the maximum value...
1
by: cathycros | last post by:
Hi, I'm trying to take data from varchar fields in one table and copy it to Nvarchar fields in another table. (Long story - now dealing with multiple languages, not enough space in row in current...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.