Default to VBA NOT Embedded Macro
Thank you for taking the time to report an issue.
What's wrong... Please write below.
I have tried using:
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
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).
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?
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
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
Is there a way to change the default value on a number of tables using VBA code or 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
This macro has been working fine until I added an additional sub form (with no connection to the macro) to the form then the macro was failing with the message:
"The command or action RemoveTempVar isn't available now" when you click ok it opens the macro failed message box.