Solved Find & Replace: Update Query and Form (1 Viewer)

Sarah.M

Member
Local time
Today, 07:05
Joined
Oct 28, 2021
Messages
335
Hi, Plz note, My VBA is disabled for security reason.
I can use only Expression builder, Macros, Queries, Tables, Forms and Reports only.
------------------------------------------------
Hello,
1.I have a closet with a shelf and a folder. I want to do a search and replace, so that if I want to change some data or bulk of data.
2.if I chose User to filler the table I got Parameter I do not know why? if I type the name it is work but it does not work if I choose from drop down list
I tried but it does not work with me plz help
Sample Attached
 

Attachments

  • FindAndReplace.accdb
    508 KB · Views: 337
  • 2.png
    2.png
    12.3 KB · Views: 298
  • 1.png
    1.png
    18.7 KB · Views: 321

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:05
Joined
May 7, 2009
Messages
19,233
check and test your replace form.
see also changes to your update query.
 

Attachments

  • FindAndReplace.accdb
    512 KB · Views: 336

Sarah.M

Member
Local time
Today, 07:05
Joined
Oct 28, 2021
Messages
335
check and test your replace form.
see also changes to your update query.
I'm curious for learning,
why my way SetFilter or ApplyFilter did not work? why he keeps show me [Parameter]
I used it before it works fine, but now I got this [Parameter]
Just for learning
Thanks!
 

Sarah.M

Member
Local time
Today, 07:05
Joined
Oct 28, 2021
Messages
335
check and test your replace form.
see also changes to your update query.
You did great job @arnelgp , but I have small problem, if I click it does not changed
For example I want to move all "Jan" Files from Cabinet "1" to Cabinet "10"

Also, I want small thing that if I click on Replace/Transfer I got Msg box
If it ok show " Changed Successfully"
if my input in search area not correct "Please try again"

Plz help me!

1637691576188.png
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:05
Joined
May 7, 2009
Messages
19,233
here test it again.
 

Attachments

  • FindAndReplace.accdb
    508 KB · Views: 286

Sarah.M

Member
Local time
Today, 07:05
Joined
Oct 28, 2021
Messages
335
here test it again.
Hi, thank you for your reply, I got this error message
my Access is 2016 64bit I think Nz working with only 32bit
plz help!
 

Attachments

  • 1637731040018.png
    1637731040018.png
    3.2 KB · Views: 244

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:05
Joined
May 7, 2009
Messages
19,233
i am using A2021 x64.
copy this query to your update query:
Code:
UPDATE Q1Find SET
Q1Find.UserNameFK = Nz([Forms]![F1]![RepUser],[UserNameFK]),
Q1Find.CabinNum = Nz([Forms]![F1]![RepCabin],[CabinNum]),
Q1Find.ShelfNum = Nz([Forms]![F1]![RepShelf],[ShelfNum]),
Q1Find.FolderNum = Nz([Forms]![F1]![RepFolder],[FolderNum])
WHERE (((Q1Find.UserNameFK) Like [Forms]![F1]![SerUser] & "*") AND
((Q1Find.CabinNum) Like [Forms]![F1]![SerCabin] & "*") AND
((Q1Find.ShelfNum) Like [Forms]![F1]![SerShelf] & "*") AND
((Q1Find.FolderNum) Like [Forms]![F1]![SerFolder] & "*"));
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:05
Joined
May 7, 2009
Messages
19,233
ok, i don't know if you have the complete "reference" in your vba.
you might try replacing the Nz() with IIF(), example:

...
Q1Find.UserNameFK = IIF(IsNull([Forms]![F1]![RepUser]), [UserNameFK], [Forms]![F1]![RepUser]),
...
 

Users who are viewing this thread

Top Bottom