Topics Search

VBA Code in Access w/ option buttons

VBA Code in Access w/ option buttons
Views: 275
I have created 2 option buttons in Ms Access 2007, on a blank form. The scenario is: I have a database with different events, and each event has there own ID. What I need to do is when I click one option button and hit a command button, it then exports that file into excel based on the eventID from the option button that I selected.

Can anyone give me a hand on this?

Its really important, that I get this answered. Its for my job
Sponsored Links:

More topics


Hiding option buttons based on other option buttons

I'm making a report in Access 2003. I have one sent of option buttons named workingorder and another set named compcondition. When option 1 and 3 are selected in workingorder, I would like compcondition to be hidden. When option 2 is selected, I need to see compcondition.

I have limited experience with code so hopfully it's just an easy fix that I'm missing. My code in the On Open event for the report is:

Private Sub Report_Open(Cancel As Integer) If Me.fmeLMASWorkingOrder = 2 Then Me.fmeLMASCompCondition.Visible = True Else Me.fmeLMASCompCondition = False End Sub

It tells me I have an expression that has no value and highlights "If Me.fmeLMASWorkingOrder = 2 Then"

I've tried a couple different ways can can't get this to work

Option Group Reference In VBA

I have an option group on my form comprised of eight check boxes. How do I refer to the individual check boxes of the group in VBA?

The option group frame is frame27, the first buttons name is check30.

Lastly, to indicate check30s state when checked do I use true/false or the option value in its property sheet

Using an Option Group to Filter a Microsoft Access Form

You can use an option group on a Microsoft Access form, report, or data access page to display a limited set of alternatives.
An option group makes selecting a value easy because you can just click the value that you want.
Only one option in an option group can be selected at a time.
In a form or report, an option group consists of a group frame and a set of check boxes, option buttons, and toggle buttons.

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

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?

Querying a database with optuion buttons

I am trying to query a few tables by the use of a combo box and a set of three option buttons. The form will search my tables using the value in the combo box and selected option. The problem I am having is with the option buttons and knowing how to query my tables using them.

My problem is the option buttons don't refer to a single record. for example: the first option will be current which I want to select "active" and "possible" in out of one of my tables. The second option button "Cleared" will select only "Cleared" from the table and lastly the option "All" will select all records.

Create Check Boxes/Option buttons/Option Group using VBA

Im really stuck on how to create: Check Boxes/Option button/Option Group in VBA.

Could someone help on either all of them or some of them please

Access 2007 option buttons

I have a form with five option buttons on it. I have five fields in the main table, ME1, ME2, ME3, ME4, and MS5. I have two issues:

1. I am having difficulty getting the group of option buttons to allow one and only one to be selected.

2. If the ME1 button is selected, that field in the table will be populated, if ME2 is selected the ME2 field should be populated, etc, for each record.

Access Help, Tips and Tutorials

If you are finding that you are getting unexplained errors with your applications as you develop or you have noticed that it seems to be running slower then it may be time to use the rarely mentioned decompile option on your application. When you compile VBA code various pieces of old code often get left behind. Decompile is a relatively unknown Access feature than can help drastically reduce the size of front end databases and also reduce bloating and decrease start-up times is the /decompile option. The /decompile command line option cleans out these bits of code and allows for a fresh start.

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.