Topics Search

VBA Module to Find/Replace

VBA Module to Find/Replace
Views: 121
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

Preview
I want to perform editing(find and replace) 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 didn't work.
 

(vba) edit module n macro in different access db

Preview
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

Preview
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

Preview
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

Preview
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

Preview
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
 

Use the Find and Replace dialog box to change data

Preview
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.
 

Assign vba module code to a access form button

Preview
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

Preview
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()
DoCmd.Close
End Sub

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

Need module to replace MS Access Database

Preview
I intend to replace my ms-access database by my dotnetnuke portal.
The database holds adresslists and projektdata in more than 50 related tables. Now I'm looking for a dnn-modul to easily create forms and reports like it is possible with ms-access. Is there any module out there to meet this demand ?