Results 1 to 4 of 4
  1. #1
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    486

    Access equivalent of Approach Fill Field

    I am moving my user off an old Lotus Approach database to Access. They are very used to using Fill Field in Approach. It would allow you to find a set of records, then choose the field you want to update, then enter a value you want it set to and it would go and update that field for every record in the found set.

    What is the best way to get an equivalent action in Access.

    Here is what would happen:
    User opens form


    Users selects Filter By Form
    Users gets back a found set of records
    **User needs a way to update the lease end field for every record found

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Requires VBA code. Options:

    1. run an UPDATE sql action using the same filter criteria. Sample syntax:
    CurrentDb.Execute "UPDATE tablename SET fieldname=" & Me.textboxname & " WHERE fieldname=" & criteria

    2. cycle through records on form, this requires code that moves to each record and modifies value
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    486
    Thanks, however the current filter is done by the form, not by any filter criteria i have set so the Me.textboxname would be whatever field the user is clicked in. Not sure if access can use the active field as a variable.

    Something like:
    CurrentDb.Execute "Update currenttable set fieldname=" & Me.OnFocus & "Where fieldname=" & criteria

    the vba code to move to the next record would be something like

    Code:
    Private Sub cmdUpdateFieldValue_Click()
        Dim rst As Recordset
    On Error GoTo Err_cmdSetAll_Click
    Set rst = Me.RecordsetClone
        With rst
           .MoveFirst
           Do 
              .Edit
            
               CurrentDb.Execute "Update currenttable set fieldname=" & Me.OnFocus & "Where fieldname=" & criteria
              .Movenext
           Loop Until .EOF
        End With
    Exit_cmdSetAll_Click:
        Exit Sub
    Err_cmdSetAll_Click:
        MsgBox Err.Description
        Resume Exit_cmdSetAll_Click
    End Sub

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Not something I've ever tried.

    Problem is, the field no longer has focus when user clicks the 'cmdUpdateFieldValue' button. The button has focus. So I think this gets terribly complicated with globally declared variables and setting the variables every time a data control gets focus and using the variables in the button procedure.

    Why is there a need to do a mass edit like this? Why does changing value for one record need to be reflected in other records? How do you 'find a set of records'?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Generate Scripts equivalent for MS-Access
    By xfp39024 in forum Access
    Replies: 1
    Last Post: 07-13-2013, 04:31 PM
  2. Auto Fill a field? Access 2007
    By ldybugs4me in forum Database Design
    Replies: 1
    Last Post: 03-07-2013, 02:21 PM
  3. Replies: 1
    Last Post: 09-30-2012, 07:03 AM
  4. Replies: 11
    Last Post: 07-28-2012, 03:55 AM
  5. Replies: 4
    Last Post: 05-18-2012, 06:07 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