Topics Search

Default to VBA NOT Embedded Macro

Default to VBA NOT Embedded Macro
Views: 27
I hope someone has some good news about making Access 2007 default to use VBA not embedded macros .
Sponsored Links:

More topics

 

Run a Embedded Macro from VBA Code

Preview
I am trying to rerun an embedded macro which is attached to the AfterUpdate event of a combobox. Is there anyway of rerunning this query from VBA Code?

I have tried using:

DoCmd.RunMacro

However it says you need to insert the Macro name however I do not know what the embedded macro is called in order to refer to it
 

Embedded Macro's

Preview
I have been looking over a customer order db that the programmer doesn't't use any Embedded Macro's. Everything is in VBA. I use Embedded Macro's on all my cmdButtons. Whatis the advantage to not using Embedded Macro's.
 

Create a macro

Preview
In Microsoft Office Access 2007, macros can be contained in macro objects (sometimes called standalone macros), or they can be embedded into the event properties of forms, reports, or controls. Embedded macros become part of the object or control in which they are embedded. Macro objects are visible in the Navigation Pane, under Macros; embedded macros are not.
 

Storing a DAO.RecordSet/DAO.QueryDef in a TempVar in an Embedded Macro

Preview
In an embedded macro, is it possible to use a TempVar to store a DAO.RecordSet or DAO.QueryDef? Or otherwise, is there another way to use a Recordset or QueryDef in an Embedded Macro?

For example, say I have a Table (called myTable), that has 2 fields, ID, myFieldA. I want to make a Form that has an Unbound text box (say, boxA). Then, I want to make an Embedded Macro that queries myTable, using ID as the criteria field, so that the query would return only one record.

The Macro would then temporarily store the RecordSet, so that it would populate thetextbox, boxA, with the value of myFieldA from the query.

I know about binding boxA to myFieldA. I also know how to do this using VBA. But for my purposes here, I want to keep all of the form elements Unbound, and drive the user interface with queries, using only Embedded Macros.

Then I could use smarter logic for doing things such as validating that the user fills in required boxes before writing records to the table, verifying that the user intends to save changes, etc.

(I've had enough pain dealing with Access' clunky BeforeUpdate and AfterUpdate events).
 

Changing Default Table Value Using VBA/Macro

Preview
I'm doing a shop database, and I'm using the default value to store VAT values.

Is there a way to change the default value on a number of tables using VBA code or macros
 

VBA Code for buttons, Access 2010

Preview
In using this new version of Access, I have found that when creating buttons, Access no longer uses vba codebehind to handle all the dirty work - rather, it seems Microsoft is forcing me to use the upgraded (and very nice I must say) Macro builder.

This is fine for all the simple tasks, but what I have myself into is a little more complex than the Macro builder is ready tohandle I think.

Before, when I created a button, not a Macro. I am trying to build the following button types:

Button 1 - Update a Field in a table, Save form, Close form
Button 2 - Update a field in a table, save form, new record
Button 3 - Update a field in a table, save form, print report, close form . and so on and so forth.

I used to put 3 or 4 buttons on the form, then copy and paste the generated vba in the correct order in a single button, and delete the dummy buttons. But now it seems as the basicfunctions are built using an embedded macro, and when that is combined with VBA, Access must choose between one or the other, rendering my button useless.

Is there a setting in 2010 that will change the way buttons are created in that VBA is used by default instead of macros?
 

VBA or Macros

Preview
I am building my database base on a template I got off of the Microsoft Access Website and it includes a combination of embedded macros and event procedures, VBA.

At this point I am not having too much problem editing either to get what I need to done, but that does not mean that I understand either very well at this time. However I am really trying to think about this database from a macro point of view and do things the right way the first time and not just what works just for the moment. I want to plan for this database to be upscaleable and to probably work on a network which may mean that the backend will reside on an SQL server. I am trying to learn and understand VBA, which I will take any reference recommendations on, but at this point both VBA & Macros are just greek to me.

So the question is should I be trying to convert all of the embedded macros to VBA or visa versa? Or is everything OK the way it is and if it ain't broke don't fix? What are your
 

Embedded macro

Preview
I have not worked with embedded macros before. The previous Access developer created one in a form and I am trying to understand how to get to it to view/modify. Since it does not appear in the navigation pane, how can I do this?

In the navigation pane there is a macro "mcrImportDetails". I open that in design view and see the columns Macro name, Conditions, Action & Arguments. The macro I want to look into in the Macro name column is "Import_DailyDetails" - how do I see this in design view? Not sure if my info is vague, please let me know if I can provide any other information. I know that the macro is importing an Excel file
 

Embedded Macro Test Strategy

Preview
Does anyone know a good way of testing embedded macros?

When you are building or reviewing the macro, Access does not permit access to any other part of your database and there are lots of reasons why it would be nice to have that ability.

The only help I have found is to have the VB window open so I can check the value of variables and test expressions while I'm building the macro conditions
 

Change Wizard Default to VBA

Preview
I am having lapse in memory. I know that you can change the default when you use the Access Wizard in 2007 to have it create the action in VBA versus the Macro default. I just cannot recall where this is located to make the change. I also thought the I had made this change on a global basis but recently opened a new data base and found that it was creating simple wizard commands embedding macros. I know how to convert them, but much prefer that they be created in VBA