Topics Search

VBA Module to Find/Replace

VBA Module to Find/Replace
Views: 131
to solve my big headache, I have table with a lot of records and every record contain unique number. However couples hundred of records have new number and I need to find and replace. I can do that one by one, but this is waste of time specially when I have those numbers in multiple tables.

I have one table tbl_status with two column:

OLD_num and NEW_num

Something like this:
P2345 P3445
P1000 P3446
P123 P3447

Than I have table with data tbl_Articles

Now I will like to make VBA function to loop thru table tbl_Article and if find any of number listed in table tbl_status under field OLD_num to replace with NEW_num

I hope I did explain well, English is my second language
Sponsored Links:

More topics


(vba) edit module n macro in different access db

im stuck in vba for last 2 days.
I want to perform editing module(s) and macro(s) from different access database(s).

no progress in editing ( find/replace text ) macro,

well this is my code for replacing word in module ( please see attachment )
its only works when in the same database,
but as soon as I add 'Set Dbs = OpenDatabase(dbname) it didnt work

Find and Replace on a huge amount of records

I am trying to find and replace certain characters that are in every field of table.

The catch is: The table has 600K records in it.
So when I use CTRL H (Find and Replace), it works great.but only for the first 10000 records or so. It won't do any after that.

Then I found a module:

Public Function fReplace(ByVal Expression As String, ByVal Find As String, ByVal Replace As String) As String
Dim strTmp As String, n As Integer

Use the Find and Replace dialog box to change data

This topic explains how to use the Find and Replace dialog box to find and optionally replace data in an Access database.
* Learn about using the Find and Replace dialog box
* Find and replace data in a table
* Find and replace data in a form
* Find data in a query result set
* Find wildcard characters
* Examples of wildcards in use
* Find quotation marks and null or blank values
* Find and Replace dialog box control reference

Replacing a Filter Query in a Module

I created a Form which I want to open with one of four different filters (depending on how I want the data to be sorted). I also created a generic filter (called FilterForm) which I will always use to open the Form.

I want to create a Module to replace FilterForm with one of the four sort filters (FilterSortA, FilterSortB, etc.) depending on a parameter I pass to the Module.

My problem is I cannot seem to find a Module statement which will allow me to copy/overlay FilterForm with FilterSortA. In Macro language there is a DeleteObj and CopyObj command but I have to hardcode the FilterSort names which I want to avoid.

So my question is, is there a statement(s) which I can code in a Module which will allow me to replace FilterForm with FilterSortA, FilterSortB, etc.? Thank you for your time.

Find and replace question

There is a table in one of our MDBs that I need to add a character at the end of every record in a column

I tried using find a replace and Finding * and replacing with *U2 but that just replaces everything with literally *U2.

I have tried using combinations of ^&U2 with similar results.

Is there a simple way to accomplish this using the Find/replace dialog box

Assign vba module code to a access form button

I know there is a way to do this, but cannot find it on the web. I want to take eight different functions, all contained in one vba module, and run all of them with the click of a button I created on a form

VBA Code To Global VBA

s I have a question about saving VBA As Global Module.

While working with Access and VBA There are many VBA codes which we use very frequently for example:
Private Sub close_Click()
End Sub

How to save this as Module and then call to a button

Use the Find and Replace dialog box to change data

You use the Find and Replace dialog box when you want to find and optionally replace small amounts of data, and when you are not comfortable using a query to find or replace data. The dialog box resembles the Find tools that you see in other programs, but it contains some features that make it more useful for searching relational databases. For example, you can search on a format applied to data, and you can choose to match part or all of the data in a field.

Get the "Replace" out of Find/Replace

I have a find button on my form that opens the Find/Replace dialog. Because I don't want my users wantonly replacing half the entries in the table, my find button first sets AllowEdits to False.

The problem I'm having is setting it back to True when the dialog is closed. I've found that if I set it before the Find dialog is closed, the Replace tab will magically appear when it gets focus again. Is there a way to tell if the dialog is still open before allowing edits?

Use Find and Replace in Access 2007

You can use find and replace in Microsoft Access 2007 to find a field and then replace it with a different field in a quick and easy manner. Watch this video tutorial to find out how to use find and replace in Access 2007.