VBA Code for buttons, Access 2010

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?

Sponsored Links:

Related Topics

VBA code from Access 2003 not working in Access 2010
I have been working on converting an old Access database from version 2003 to 2010. I had some minor success with using Access 2007 to assist with part of the conversion. The database links to, updates and creates Excel spreadsheets.

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:
[code]
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.


VBA 7 Reference for use with Access 2010
I have turned the Microsoft website upside down trying to find the VBA 7 Reference Manual. No luck. Can anyone point me in the right direction?

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


Access Crashing
Has anyone else seen this type of issue

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


How to you tell Access 2010 to run VBA code?
I started with creating a Macro in Access 2010 which is very repetitious (open a query, update and close. move to next query). I used the Macro builder to make sure I got the right code commands and then converted to VBA because it is my understanding running code is better than running a macro (but I still haven't seen anything thatexplains to me why that is so).


Depolying ACCESS 2010 runtime
The database cannot be opened because the VBA project contained in it cannot be read. The database can be opened only if the VBA project is first deleted. Deleting the VBA project removes code from modules, forms and reports.

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


VBA Code to prevent editing in Access 2010
I recently purchased Access 2010 and have created a DataBase, a Data Entry Form and a split-screen form. The split-screen form is ideal for inquiring the DataBase, but it permits anyone to change values in the DataBase. Can VBA code be written for a module that will prevent whoever opens the split-screen form from changing any value within the DataBase? Now the hard question. I do not know VBA, so is there a volunteer willing to write that code? Any


Where to see the VBA code behind the form ?
Many years ago when I last used Access, I could see the code behind a form, where I could see the code behind the different buttons on the form and so on.

Where can I see this VBA code ?

I use Access 2007 now, if it matters.


Access 2010 now creates macros instead of VBA code
I have been using 2003 for a while but I have switched to 2010 recently.

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


Unable to open code window
With both Access 2007 and 2010 I am unable to open the VBA code editor. In each, I click Create >> Module or VBA Code and Access goes into a non-responding loop.


create a calendar from scratch using vba in access 2010?
I would like to create a similar scheduling system using access vba based on the link below. Is it possible to create such a system on ms access 2010. I know this can be achieved on access 2007, but I'm not sure that if I created it in access 2007 and then migrated it into access 2010 it will appear.

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]


Compact & Repair in Access 2010 - vba not working
I have the following code which is executed when the user chooses to close the database by clicking on the exit botton.
[code]
As you can see, I've adapted it so that it should compact and repair regardless of Access version, however, it's not compacting the database in Access 2010 - why not? The code recognises that it's Access 2010, and therefore executes [SendKeys "%(YC)", False], but nothing happens.the database just goes on to close (which is correct). However, if I manually click the compactand repair button, it works!


Will Access 2010 run an Access 2007 application?
According to what I've read, Access 2010 uses the same database format as Access 2007. So this should mean I can open and run a 2007 database (with a lot of VBA code) in Access 2010 with no trouble, yes?

So why do I have the feeling that something is not going to work? Is it because I have been through too many Access upgrades


Access 2010 - SP1 and October 2011 Patch
Once the fix is available sometime this month in the October Cumulative update, the KB article will be updated with information about the patch including where to download it from, how to install it, and prerequisites to the install.

2625046 Access 2010 crashes in VBE7.DLL after installing Office 2010 SP1 [LINK]

After spending the morning reading the Microsoft Answers site titled: "Access 2010 SP1 - You receive random crashes in certain database or when opening the VBA window in those databases after installing Office 2010 SP1"

It appears that MS Office 2011 including MS Access has a problem with the new versoin of VBA. It is described by coders as catastrophic. Replace 'random" with constant. Also add code erased.

when, where and results if anyone else is involved in Access 2010 SP1.


access oracle database from MS access
I have a set of forms in my MS access database and have linked it to oracle database with ODBC. With the link tables now available , could someone help me out as to how to write VBA code for the buttons so as to retrieve info from the oracle database ?

I would be happy if you could provide a sample VBA code for this querry i.e. when the student id is selected through drop down list and Search button is clicked it must go and look up in the table in oracle and must give all the students details


VBA Combo Box
I am studying VBA and combo boxes. I have been directed to some great video, but I havent been able to code it get it to work. I need someone to code in VBA (Access 2010) so that the combobox (CmbYear) only shows the three dates (1992, 1993, 1994) only once. Then when I choose one of the dates in the CmbYear that only the records for that date shows up in datasheet view. I need it well documented so that I can use this as a learning tool. Please find compressed file
If someone will code this for me I will be eternally grateful and name my next kid after you <G&gt


Unbound text control on report no longer working in Access 2010
I have an Access 2003 database that I am now opening in Access 2010. I use a form to 'build' a report populated by what the user selects on the form. The VBA code behind the form builds a fliter string, opens a report and applys the filter to it. This allstill functions fine, but the report header is an unbound text box which is given a value from within VBA depending on what the user chooses on the form.
The Header still works OK if you run the database in Access 2003 (other PCs in our school are still using it), but when I use Access 2010, the report header is blank, both on screen and when printed!
all strings and variables are correct!

Here is the code that opens the report and applies the filter.


Access 2010 PDF and Email a Report Using VBA Code
I'm using Access 2010 and found the Send to Email as PDF command indispensible. However, I have a problem in that I've hidden the main ribbon from my users which means they can't actually click that button.

Can anyone tell me the VBA code that will let me PDF and email an indiviual report based on a given unique ID. I am happy for the user to add the email address, subject and message body and for them to click send


How to halt vba code while a form is open
Access 2010. Here is an extract of vba code
Code...

The idea is to have the code halt while form FRMLatefEEManage is open. The form needs to be usable.
When form is closed, the code can continue. The form opens but isn't full size and doesn't behave as it normally does. Is acDialog the only method to have the code halted while the form is open ??


VBA editor
I am revamping my 13000 record database in Access 2010 to try and learn 2010. It was original made in Access 2000. I went back to an old computer running 2000 copy of the DB to try and remember what it was that I was trying to accomplish with certain visual basic code, and found I cannot remember how to view the VBA editor. My memory seems to think that I there was a visual basic command under the view menu but its not there. I tried the help menu but the help file directions of clicking in the eclipse only brings up the macro or the query. How do I open the VBA editor


Convert access 2003 to access 2010
I'm planning a conversion of access 2003 to access 2010 and I wonder if there are already known issues that will cause problems in the corresponding VBA code.
I have knowledge of the calender ocx, but I'm sure there are a lot more and I wonder if there is a list