473,472 Members | 2,184 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

I created form with 4 option button. How can I write click command in build event?

10 New Member
How can I write click command in build event for my form using option button? Here I wrote like that, but when I click option1 it doesn't work. thank you

Expand|Select|Wrap|Line Numbers
  1. private Sub Report_Selection_Click()
  2.  
  3. Select Case Me.Label1
  4.  
  5. DoCmd.OpenReport "total", acViewDesign
  6.  
  7. Case Me.label2
  8.  
  9. MsgBox "The job is done !"
  10.  
  11. End Select
  12. End Sub
Oct 28 '10 #1
2 2924
NeoPa
32,556 Recognized Expert Moderator MVP
I'm guessing the confusion is due to difficulties with English. I'm afraid you will need to express your question more clearly though, as currently I can make no sense of it at all.
Oct 28 '10 #2
colintis
255 Contributor
I'll put my guessing in from what I understand if its true....

As I can see you giving an event on clicking the COMMAND button. Then your select case on label1 is not opening the report, because the structure is not correct, the select case in here is looking for something to compare with label1 (whatever things inside). The next line case with label2 is telling Access to check if label2's content is the same as label1's content. Therefore, the whole select case is WRONG.

If you are trying to make selectable options to choose from, you will need to first create an option group, then create option buttons (the circle with a black dot) within the group. And from my guessing, you tried to make selection first with the options, then a command button click event to perform certain things. So after creating the options in the option group PLUS naming correctly, you should have a structure like this
Expand|Select|Wrap|Line Numbers
  1. private Sub Report_Selection_Click()
  2.     Select Case <Option group name>.Value
  3.         Case 1    'If option 1 is select
  4.             DoCmd.OpenReport "total", acViewDesign
  5.         Case 2    'If option 2 is select
  6.             MsgBox "The job is done !"
  7.     End Select
  8. End Sub
Oct 29 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jared | last post by:
Radio Button or Check Box and Event Procedures I need to insert either radio buttons or check boxes onto my form. I'm not sure which to use, or if there are other options. I am using the buttons...
1
by: Mark | last post by:
Hi All, Is there anyway I can select an option button by clicking a command button? From what I have found out so far, unlike a check box, and option button has no value so I can't assign it one....
4
by: BerkshireGuy | last post by:
I have a optionbox with two options. Depending on what option the user selects, I have code that populates a listbox using a select statement. The code is working fine expect that when the...
8
by: John | last post by:
Here is the current error that im getting when building my solution. The only thing i can think of is that i needed to install visual studio 6 after visual studio .net was already installed to...
3
by: PJ6 | last post by:
I've added a button to a class inheriting from System.Web.UI.Control and want to handle (pass on) its click event to the page that contains it. Coming from a WinForms background, I thought this...
10
by: jerry.ranch | last post by:
I have a series of comboboxes on a form that are used to display forms in DS view (theres a qry behind it all). This is working well for me. Some people like to see the data in DS view, some in...
1
by: Stephen D Cook | last post by:
What I am trying to do is have a set of option buttons which are required to click one. If the person doesn't click any before insert, they get an error. If they do click one, it inserts into the...
1
by: Stephen D Cook | last post by:
In my form I have an option group with 3 option buttons. My form is tied to a table. the options are Temp, Permanent and Overtime. I have these inside a frame. I have an AddRecord button to enter...
3
by: abidh | last post by:
Hi Guys, First of All, Hi to Everybody. This is my first post here and hope to have long time with you guys. SO Coming to the point. I am new in Access and lots of things to cope with. At the...
0
by: Spellwvr | last post by:
Hi, I have a windows form application. I'd like to write the current version attribute out to a logfile automatically when the build completes. I've been looking at the post-build events and these...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.