Topics Search

(vba) edit module n macro in different access db

(vba) edit module n macro in different access db
Views: 38
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
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.
 

Running a VBA Module from a Macro

Preview
How do you run a VBA module from a macro? I tried the OpenModule action, but all it did was to open the module. I had thought this would run it since OpenQuery runs the query, not just opens it.
 

AutoExec Macro in Access 2010

Preview
I've created an AutoExec macro in Access 2010. I want it to hide the ribbon bar on open.

DoCmd.ShowToolbar "Ribbon", acToolbarNo

However, using the macro builder I use the "ShowToolbar" action but it doesn't recognise the "Ribbon" toolbar name. Is there a different name I should be using here or can I create an AutoExec VBA module?

Edit: Think I might have sorted this actually - I created a function with the above code in a VBA module and just created an AutoExec Macro which calls the function. Is that the best way to do what I'm trying to do?
 

Renaming external file from within a macro

Preview
I only need to rename a txt file created by a dos procedure invoked by an Access macro through the same macro. What happens is that the txt file just created seems to be held by the macro, because if I try to rename it through a VBA module inside Access database by runnig it after the creation during the macro, nothing happens, conversely if I let the macro finish and execute the VBA renaming module inside a new macro, it works fine. Maybe I need to create an external exe vba file to rename the txt file to be invoked by the main macro?
 

Creating a macro to send a module!

Preview
I want to create a macro to send a module, the module however must output in an excel xls version, to top it off the output must be split into different tabs of which I have already created in vba!

So I've made a macro > sendobject and argument is> Module, 0-2 Days, Excel97-Excel2003Workbook(*.xls), [LINK], , , days, test, No,

the 0-2 days is the file name and the email is made up for confidential reasons!
 

Module Error in Macro

Preview
I have created a module as below, which when I use Run in the VBA window does exactly what I want it to.
However when I then run this from a macro I constantly get a message box saying that
"the expression you entered has a function name that the [database] cannot find"

In the macro I have used Run Code with ChangeDataType() as the function name. The module is called
...
I'm stumped as I have tried every permutation of naming for the function I can think of, but still it sends an error every time.
 

Access crashes when editing VBA

Preview
I can start Access and VBA module without problems.
But when I edit VBA (first keystroke) Access VBA plugin freezes and crashes.

Problem is on all databases using VBA
If I log on as a other user, problem isn't there.
I use Win7 64bit, Access 2010 32bit
I use .mdb format only
I've tried access.exe mydatabase.mdb /decompile

I would log on as other user, rename c:\users\myprofile and thus force it to create a new profile for me. But Windows 7 just creates a temporary profile as it can't find the old one.
I would prefer not to delete my profile through control panel, as I would like to be able to undo the change

EDIT: Actually, this might not be an VBA issue - I found out that I have no problems editing VBA code that has no forms (GUI), so the problem just might be regarding Forms and not VBA
 

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
 

Converting Excel Macro into Access Module

Preview
Is there a fast way to convert an excel macro into an Access Database Module? I have two large codes that are currently being used via spreadsheet, and would like to run the same macros on a Query.

Can this be done
 

Converting Excel Macro into Access Module

Preview
Is there a fast way to convert an excel macro into an Access Database Module? I have two large codes that are currently being used via spreadsheet, and would like to run the same macros on a Query.

Can this be done?