Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2013
    Posts
    2

    Unanswered: Custom Find and Replace Access Form with match criteria “End of Field”.

    I want to create a “custom Find and Replace form” to directly work (Find and Replace operations) on opened table. I need “custom Find and Replace form” to perform all function as the default “Find and Replace” and also perform all functions for new added match criteriaEnd of Field”.

    I am attaching database here, in which I have created functionality of “Replace All”. Kindly help and modify the attached database according to above specification.
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    ?
    so you are runnign an update query
    update mytable set anumereicolumn = 456, astringcolumn = 'astring', adatecolumn = '#yyyy/mm/dd#'
    where....


    then you need to build your where clause (thats the thing that limits the rows affected)
    Code:
    dim strWhereClause as string
    strWhereClause = "WHERE 1=1" 'elmplys a SQL dodge which forces the where alwasy to be valid
    if not isnull(mycontrol.text) or len(mycontrol) >0 then 'add this setting to the wqhewre clause
    ''...if acolumninmydb is numeric
      strWhereClause " AND acolumninmydb = " & mycontrol.text
    ''...if acolumninmydb is character/text/string
      strWhereClause " AND acolumninmydb = '" & mycontrol.text & "'"
    ''...if acolumninmydb is date
      strWhereClause " AND acolumninmydb = #" & fortmat(mycontrol.text,"YYYY/MM/DD" & "#"
    '.. depending on hwo that control is populated you may want to check the value ois a valid date before entering it
    'eg if isdate(mycontrol.text) then....
    endif
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jul 2013
    Posts
    2

    Thumbs up Custom Find and Replace Access Form with match criteria “End of Field”.

    Hi,

    Thanks for your prompt reply...
    My concerns are:

    Control 'Find Next' - must go to match field one by one with each click.
    Control 'Replace' -must replace match field one by one with each click.
    Control 'Replace All' - Done....

    These must work for 'Match Case' or without.

    Cursor focus must move to each record in 'Find Next' & Control 'Replace'. I mean first go to match field then, update.

    Kindly help me....

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    frankly I don't have the time (and to be honest the inclination) to do that in any detail

    however
    so you need a form with the relevant controls on
    that form also needs to have your find replace dialog
    create a recordset from the search criteria (make certain you include the primary keys for the rows you expect to modify

    display each row from that recordset
    place code behidn the update/change uses, say a domain function or another recordset to update the row using the primary key
    display the next row in the original recordset
    iterate through the original recordset
    I'd rather be riding on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •