Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / November 2006

Tip: Looking for answers? Try searching our database.

Updating table automatically help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeffshex - 28 Nov 2006 22:07 GMT
I am looking to see if I can update a field, based on conditions from 2 tables.
tblCustomers [CustomerID], [Status]
tblBid [BidID], [CustomerID], [BidDate]

I need to run a DateDiff to find out if between Today and BidDate has been
>30 And their Status = "Bid/Estimate"
If that holds true, I want to change the Status to "Follow-Up".

I'm not sure how to run code or even begin putting it together.
I need some advice!
Daniel - 28 Nov 2006 22:21 GMT
Is this to be done in a form as a user enters data or are you looking to do
bulk processing of all the entries in your table?

Daniel

> I am looking to see if I can update a field, based on conditions from 2 tables.
> tblCustomers [CustomerID], [Status]
[quoted text clipped - 6 lines]
> I'm not sure how to run code or even begin putting it together.
> I need some advice!
Jeffshex - 28 Nov 2006 22:25 GMT
Bulk Processing.

I just did a query that has the customer ID, their BidDate, Status, and a
calculated field between Date() and BidDate.  I suppose I could run some code
off of that to update where Status = "Bid/Estimate" and DaysPassed > 30.

Thoughts?
John Spencer - 29 Nov 2006 12:52 GMT
So, what do you want the status to be if a customer has multiple bids?  The
SQL below doesn't care if you have mutliple bids

UPDATE tblCustomers INNER JOIN tblBid
ON tblCustomers.CustomerID = tblBid.CustomerID
SET TblCustomers.Status ="Follow-up"
WHERE tblBid.BidDate <= Date()-30 and
  tblCustomers.Status = "Bid/Estimate"

If you already have a query that shows which records you want to update then
all you need to do is open it in design view and select Query: Update Query
from the menu.  Then in the update to enter "Follow-Up" and then select
Query: Run from the menu.  You can save the changed query to another name if
you desire.

>I am looking to see if I can update a field, based on conditions from 2
>tables.
[quoted text clipped - 7 lines]
> I'm not sure how to run code or even begin putting it together.
> I need some advice!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.