VBA Code for buttons, Access 2010
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?
Thank you for taking the time to report an issue.
What's wrong... Please write below.
until this week. So, I've been trying to convert to Access 2010, with the knowledge that the users forthis app are now converted to Ofc 2010 (so there won't be any 2003 or 2007 users trying to use this).
The old app had several buttons for the users to update and create spreadsheets from a protected SQL server. Now, when they try to use the buttons (specifically, an "update" button) the coding stops.
I think I'm missing some kind of add-in or something, but can't figure out what it is or where it should be.
Here's the first part of the code, where it stops:
The debugger stops at the very first line, Access does not show me the usual prompts if I try to duplicate the second line of code. I think thesecond line is what is actually stopping this.
I have to rebuild our Access database almost completely. None of the buttons, macros, combo-boxes built with 2003 work in 2010. And none of the data validation and automation procedures I wrote in VBA using Access 2003 work.
So far I have been able to re-build many of my buttons by just playing around until I get it figured out. But simple things like getting forms to maximize when they open, or being able to push a button and open a new form with the child records of the parent displayed on the previous screen are really eluding me.
I have ordered books, but they won't be in for two weeks. I really expected most things to work when we upgraded because I did not use the menus in my application
I have a form with several buttons that call functions, one to run a VBA module, the other performs some VBA then opens a form.
Yesterday they all worked fine - today very time they are clicked they crash access.
Now here is the weirdest bit - if I put a debug stop in the code in the On_Click event of the buttons access does not crash!
Has anyone seen this before and is so how have you fixed it
You should back up your database before attempting to open the database and delete the VBA project.
My developing environment is Office 2007 ACCESS 2010. My runtime environment is Office 2007 RUNTIME ACCESS 2010.
Both ACCESS Development and Runtime are under SP1 32 bit
Where can I see this VBA code ?
I use Access 2007 now, if it matters.
I have just found out that if you use the wizards when creating a command button, Access now creates a macro instead of creating VBA code (for opening a form, for example)
I prefer code over macros, so is there a way to change this?
Also, what about the macros that have already been created? How can those be converted to VBA?.When I use the "Convert From's Macors to Visual Basic" option I get a "There was a problem opening the macro "[Embeded Macro]". Do you want to continue?" and the macro does not get converted
Is this possible to do and transpose it into access 2010? If so, how can thisbe done? Or can it be done programmatically via the date picker?[LINK]