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
- private Sub Report_Selection_Click()
-
Select Case <Option group name>.Value
-
Case 1 'If option 1 is select
-
DoCmd.OpenReport "total", acViewDesign
-
Case 2 'If option 2 is select
-
MsgBox "The job is done !"
-
End Select
-
End Sub