Results 1 to 4 of 4
  1. #1
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568

    Requring query on the fly

    Hi,

    i am using code to update rows within query:

    Code:
    With rsDao    If Not (rsDao.BOF And rsDao.EOF) Then
            rsDao.MoveFirst
        End If
        Do Until rsDao.EOF
           ' rsDao.Fields(12).RecordsetType = 1
            rsDao.Edit
            !Status_name_ID_FK = 3
            !Status_date = Now()
            rsDao.Update
            rsDao.MoveNext
        Loop
        
        Me.Requery
        Call KoszZusFaktur
        'Me.Refresh
    
    
    
    End With
    This is working on multisearch textboxes on split form:

    Click image for larger version. 

Name:	faktury.png 
Views:	16 
Size:	17.6 KB 
ID:	31800

    Now i am filtering statuses using word: "Zakończono"
    I have 2 statuses and now my code above is running.

    I am changing via code these statuses from "Zakończono" to "Wyeksportowano".
    It is working like a charm.

    Problem is to see this.
    When user is changing statuses I have to requery query and my filter is not actual, so here is nothing filtered (all statuses "Zakończono" were changes to "Wyeksportowano").
    How can i show user his changes?

    Output:


    Click image for larger version. 

Name:	uotput.png 
Views:	16 
Size:	21.6 KB 
ID:	31801

    Any ideas?
    Best Wishes,
    Jacek

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    There is no need to use code. This is very slow.
    Create an update query to do it all at once.

  3. #3
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    thank you ranman256!

    Do you think that if i write:

    Code:
    UPDATEMyTable
    SETStatus_name_Id_FK= 3
    
    it will change only my filtered values (using multisearch textboxes) or it will change my whole query?

    Best Wishes,
    Jacek

  4. #4
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    Ok i have checked it and it is owrking only for filtered values !!!
    wow,

    thank you!

    Best wishes,
    Jacek

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

Similar Threads

  1. Requring Fields based on Combo Box
    By jlclark4 in forum Forms
    Replies: 1
    Last Post: 12-12-2011, 02:27 PM

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