Topics Search

(vba) edit module n macro in different access db

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

Similar posts...

 

AutoExec Macro in Access 2010

AutoExec Macro in Access 2010 Icon
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?
 

Creating a macro to send a module!

Creating a macro to send a module! Icon
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

Module Error in Macro Icon
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.
 

Jump Start VBA Skills with MS Access Macros

Jump Start VBA Skills with MS Access Macros Icon
Macros help to speed up the performance of certain repetitive tasks when using an application. They are used extensively in all office-related software. As a programmer, you can leverage the built-in macro object in MS Access to get a head start in understanding VBA. This article explains how. TOC: Jump Start VBA Skills with MS Access Macros; Creating and running a macro in MS Access: opening the macro designer; Creating the first macro; Converting this macro to VBA code; Creating the second macro.
 

how to use or run access vba code in access 2007?

how to use or run access vba code in access 2007? Icon
We press alt+f11 then insert >> module. To run that, view >> macro >> runmacro >> refreshpt something.

similarly in access I wonder how to run vba codes. there is one option called vba in database menu in (access 2007). I clicked that and inserted modules and saved. Now I don't know how to run it in a table or query.
 

Converting Excel Macro into Access Module

Converting Excel Macro into Access Module Icon
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?
 

Excel Macro to exported ACCESS files

Excel Macro to exported ACCESS files Icon
I have read a few available functions similar to my concerns. And I have noticed some were not answered for a long time. when a query or a table has been exported to Excel from Access.

It does not open with the Excel Macro in order to run. I was able to transfer the data to Excel and I was able to open the Macro Excel but when it runs, it runs on itself not on the exported file.

As of right now all of my Transferspreadsheets are in ACCESS Macro, not in VBA and they are being exported as expected. I just need to add a RunCode using Module that will coincide with the Transferspreadsheets as it gets exported to the desired folder and run it and save.

I am pretty confident that this could beaccomplished but needs to make sure the Excel Macro is working on the exported file not on itself.
 

Using Access VBA to edit Excel document

Using Access VBA to edit Excel document Icon
So I have an Excel macro that has the following:

Sub Test()
Rows(2).EntireRow.Insert
[D2] = "ABC"
End Sub

which adds a new row (at row 2) and inserts "ABC" in cell D2. However, I need some way to embed this code behind an Access button in VBA. I understand that you can call an Excel Macro from Access, but the Excel document is changing often and will not always have the macro attached.

So my question is: How can I open the Excel document, insert a Row at line 2 and type "ABC" in cell D2, and save and close the Excel document? ALL from Access VBA,

My .xls file is named "importtest.xls" and the sheet where I want to do this editing is "Sheet1"
 

How to export macros' commands as text?

How to export macros' commands as text? Icon
I'm trying to devise a way to export code in an Access database as text such that I can use Csv meaningfully when I make changes. reports and modules, butalso the connection strings and SQL commands for queries, and the list of commands in all macros.

I've done all the VBA and queries, but I can't figure out how to get to macros' commands at all. I've examined all containers and documents in CurrentProject, all the Access objects in CurrentData, everything, and I can't find anything.

All I can do is save each macro as a module and then use the module-VBA system I have.
 

Running a module from a macro

Running a module from a macro Icon
I would like to run a module (procedure) from within a macro.
So far I have only found a command that opens it in designmode