change default values

slimjen1

Registered User.
Local time
Today, 18:54
Joined
Jun 13, 2006
Messages
562
Hi all. Using ms access 2010. I've search the internet with no avail. is there a vba code to search and change all default values in tables or criteria in queries from one word or number to another word or number at the same time? Ex. I would like to search if a default value is = to "odd" change to "even" or criteria in a number in a query = 213 change to 214. I have several tables and queries and don't know which contain the words or values need to change and it would be very time consuming design viewing all the objects to find them. Thank you
 
I'm not aware of any code as such, you could write something in VBA to go through all the tabledefs and querydefs. Alternatively on the basis this is a one off you could use the documenter to create a text file which you can then use 'find' to find the occurences which will point out where you need to go
 
Thanks for your reply. I only can think of the code to change the tbl or query names.
Code:
Public Sub PrefixTblName() 
  Dim t As TableDef 
  For Each t In CurrentDb.TableDefs 
    If Left(t.Name, 4) <> "MSys" Then 
      t.Name = "tbl" & t.Name 
    End If 
  Next 
  
End Sub
I have not used any to find and replace. I don't know how to begin to modify such code.
 
In that case I suggest you use the documenter - see attachment for where to find it (in 2010)
 

Attachments

  • ScreenHunter_01 Sep. 06 16.56.jpg
    ScreenHunter_01 Sep. 06 16.56.jpg
    13.8 KB · Views: 67

Users who are viewing this thread

Back
Top Bottom