Results 1 to 4 of 4
  1. #1
    spleewars is offline Novice
    Windows XP Access 2002
    Join Date
    Feb 2012
    Posts
    26

    Commiting changes in past records

    Got a complicated challenge (better define my last challenge) but don’t have a clue where to start: I’ll try to be accurate as possible. Apologies I might be asking for a lot of coding but this has been bothering my for a lot of weeks trying to do it myself the ‘simple’ way but failed all over every time. This is all about automatic changes in particular field of a past payment.



    Got form “Report” and subform “Bank”. The purpose of this form is to input payments made that day. In report form, the user set 1 daily record to save day details and the subform is filled with tens of records about customers and payment amounts.

    In”Report” I got 2 particular fields:

    Date: is set daily by the user
    Dailyid: (as autonumber related to the subform)

    In “Data” I got 2 important fields:

    OrderID (order id inputted by the user which is the identity of the client)
    Status: (combo box with option1, option2 and option3)

    Example: on 18-Feb-2012 customer came to process a payment. A record in “Report” is open with the daily date and another record in the subform is set to mark OrderID ‘4512452’ and ‘Status’ field, which is set by the user as default to‘option1’. On 23-Mar-2012, the same customer is about to process another payment. Apart the same procedure is performed, when the user is about to save the new payment details, the field ‘status’ of the payment before (which in this case made on 18-Feb-2012), from opion1 is set automatically set to option3

    Thanks everyone for help
    Clara

  2. #2
    R_Badger is offline Knows a few tricks
    Windows XP Access 2003
    Join Date
    Feb 2012
    Location
    Suffolk, UK
    Posts
    262
    A couple of points of confusion.

    You mention data, (I assume this is part of the datasource for the subform "Bank" but I could well be wrong), but don't mention where it ties in

    If I am reading this correctly, what you want is for the Status field to default to the same value used for the last occurrence of the same OrderID (being the client) ? is this correct? If so how do you want it to handle new clients?
    Last edited by R_Badger; 04-17-2012 at 03:33 AM. Reason: Spelling errors (I really can't type today)

  3. #3
    spleewars is offline Novice
    Windows XP Access 2002
    Join Date
    Feb 2012
    Posts
    26
    Hi Badger, thanks for your reply hope you will be better with your writing

    (added 2 pics of the form describing better my idea)

    actually, you're not entirely accurate but i have to blame myself as well coz i might had to explain a little better. To picture my real scenario, in "Status" i got 3 options as a combo box (instead of option1, option 2, option3):

    - waiting
    - paid
    - archive

    Going to my previous example, when the user inputed data in 28-Feb-2012, he set the "status" as PAID (or can even set it as waiting). When the customer returns On 23-Mar-2012, as the user is going to make a new record, the previous's record "status" (in this case the record made on 28-feb), from PAID or WAITING goes automatically to ARCHIVE...

    Please let me know if i fail to make my point clear
    Thanks


    Click image for larger version. 

Name:	uu.JPG 
Views:	5 
Size:	27.9 KB 
ID:	7201 - Report form with "bank" subform / status is set to paid

    Click image for larger version. 

Name:	aa.JPG 
Views:	4 
Size:	23.2 KB 
ID:	7202 - This is log of the payment of the client order no 82948. When new payment entered on 23-Mar- . 2012, the record's STATUS of the previous record (blue field) went from Paid to Archive.

    Last edited by spleewars; 04-17-2012 at 06:15 AM. Reason: added pics

  4. #4
    R_Badger is offline Knows a few tricks
    Windows XP Access 2003
    Join Date
    Feb 2012
    Location
    Suffolk, UK
    Posts
    262
    Here's hoping this doesn't come out as a wall of gibberish!

    We need to know a bit more about your table structure to be entirely certain, but it should be entirely do-able.

    My initial approach to this would be an update query something along the lines of:

    UPDATE [table_name] SET [Status]='Archive' WHERE [ORDERID]=" & Me!report.form!bank.Form!orderid & " and [date]<" & date() and [status]<>'Archive'"

    The idea is that using the orderID referenced in the subform the update will only affect entries regarding the current orderID, earlier to today with a status that hasn't already been archived.

    You might find the reference to your subform slightly dodgy (I freely admit that isn't one of my strongest areas, I don't tend to use subforms) and I would test the update query on sample data first before using it on live data to make sure it functions 100% as intended.

    You can test the where clause by using it as a select query:

    SELECT * FROM [table_name] WHERE [ORDERID]=" & Me!report.form!bank.Form!orderid & " and [date]<" & date() and [status]<>'Archive'"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Past Due (30, 60, or 90)
    By claysea in forum Database Design
    Replies: 8
    Last Post: 02-11-2013, 03:22 PM
  2. Replies: 2
    Last Post: 10-08-2011, 06:33 PM
  3. Reviews Past Due
    By Luke in forum Access
    Replies: 5
    Last Post: 07-19-2011, 10:51 AM
  4. Past Due Query
    By sai_rlaf in forum Queries
    Replies: 4
    Last Post: 07-06-2011, 01:53 PM
  5. Show past records for same user
    By l3111 in forum Database Design
    Replies: 3
    Last Post: 03-03-2011, 10:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums