replace finished task with new one

steve111

Registered User.
Local time
Today, 00:38
Joined
Jan 30, 2014
Messages
429
hi,

I have a table that say has 1000 records in it called " all events"
I have a subform called tasks which comes from a query from the table " all events"

at present the query is set to "no" on the completed field
I also et the date field to <=now() + 7 so I only got 8 records in my subform and report. the report shows outstanding tasks. but I don't want to show say 900

7 days worth of records is all I need to see consistently

I have now realised this is not correct
what I would like it to do is every time I tick the completed field that record disappears ( of which it does) but I would like a new record to replace it . if I tick 5 records then 5 records replace then
it would be the next record in date order




any help appreciated
steve
 
Last edited:
you mean when you tick it as complete, same task (field values also i think) will be added but unmarked?
 
hi,

I have daily tasks ( unticked ). lets say 7 days worth in my from tasks. that I can see


when I tick that days task or 2 days tasks as completed from the list of tasks these 1 or 2 tasks will disappear and the next days or next 2 days task will appear in my form called tasks. these tasks are in date order therefore there is always 7 days worth of tasks seem in my task form

steve
 
so when you tick, records go away, the task below that you ticked, goes up (get promoted) on your list, and a new task emerges from the bottom of your list of task, is it right?
 
you can't do it in query or table view, you need a form to accomplish this. you also need to add autonumber to your table (all events) and include it in your query.

on click event of your Tick control:
Code:
Private Sub [COLOR=Blue]yesNoControl[/COLOR]_Click()
    Dim rs As DAO.Recordset
    Dim lngID As Long
    Set rs = Me.RecordsetClone
    With rs
        ' set bookmark to our recordset
        .Bookmark = Me.Bookmark
        ' move to next record
        .MoveNext
        If .EOF Then .MovePrevious
        ' save the id
        lngID = ![COLOR=Blue]ID[/COLOR]
        .AddNew
        [COLOR=Purple]' do whaever you have here
        ' !datefield = Date() or Now()[/COLOR]
        .Update
        ' refresh the form to reflect the changes
        Me.Refresh
        ' requery our recordset to reflect change
        rs.Requery
        ' go to whre we were
        .FindFirst "[COLOR=Blue]id[/COLOR] = " & lngID
        If Not .NoMatch Then Me.Bookmark = .Bookmark
        .Close
    End With
    Set rs = Nothing        
End Sub
replace the blue-lettered to the correct control name, field name.
 

Users who are viewing this thread

Back
Top Bottom