sir_aingeal
Registered User.
- Local time
- Today, 09:13
- Joined
- Nov 5, 2002
- Messages
- 21
I have a main form with an option group with 6 choices, I want the user to choose one of the options which will then open a new form. The code I have on the OnClick for the group does not give me any error messages when a button is chosen but it also does not do anything. Any suggestions would be gratefully received.
Thanks
Iain
Code Follows.
Private Sub Division_Click()
Dim strSQL As String
Dim rst As ADODB.Recordset
Dim cnn As ADODB.Connection
Dim qry As String
Dim Whichdiv As Integer
Set rst = New ADODB.Recordset
'rst.Open , cnn, adOpenDynamic, adLockPessimistic
'Set strSQL = Division_Click()
Select Case Whichdiv
Case 1
DoCmd.OpenForm "frm_do_main", acNormal, , , , acWindowNormal
qry = "SELECT * FROM tbl_file_plans_divs WHERE (([tbl_file_plans_divs]![Division]=1));"
Case 2
DoCmd.OpenForm "frm_dod_main", acNormal, , , , acWindowNormal
qry = "SELECT * FROM tbl_file_plans_divs WHERE (([tbl_file_plans_divs]![Division]=2));"
Case 3
DoCmd.OpenForm "frm_scsd_main", acNormal, , , , acWindowNormal
qry = "SELECT * FROM tbl_file_plans_divs WHERE (([tbl_file_plans_divs]![Division]=3));"
Case 4
DoCmd.OpenForm "frm_csd_main", acNormal, , , , acWindowNormal
qry = "SELECT * FROM tbl_file_plans_divs WHERE (([tbl_file_plans_divs]![Division]=4));"
Case 5
DoCmd.OpenForm "frm_susd_main", acNormal, , , , acWindowNormal
qry = "SELECT * FROM tbl_file_plans_divs WHERE (([tbl_file_plans_divs]![Division]=5));"
Case 6
DoCmd.OpenForm "frm_rsad_main", acNormal, , , , acWindowNormal
qry = "SELECT * FROM tbl_file_plans_divs WHERE (([tbl_file_plans_divs]![Division]=6));"
End Select
End Sub
Thanks
Iain
Code Follows.
Private Sub Division_Click()
Dim strSQL As String
Dim rst As ADODB.Recordset
Dim cnn As ADODB.Connection
Dim qry As String
Dim Whichdiv As Integer
Set rst = New ADODB.Recordset
'rst.Open , cnn, adOpenDynamic, adLockPessimistic
'Set strSQL = Division_Click()
Select Case Whichdiv
Case 1
DoCmd.OpenForm "frm_do_main", acNormal, , , , acWindowNormal
qry = "SELECT * FROM tbl_file_plans_divs WHERE (([tbl_file_plans_divs]![Division]=1));"
Case 2
DoCmd.OpenForm "frm_dod_main", acNormal, , , , acWindowNormal
qry = "SELECT * FROM tbl_file_plans_divs WHERE (([tbl_file_plans_divs]![Division]=2));"
Case 3
DoCmd.OpenForm "frm_scsd_main", acNormal, , , , acWindowNormal
qry = "SELECT * FROM tbl_file_plans_divs WHERE (([tbl_file_plans_divs]![Division]=3));"
Case 4
DoCmd.OpenForm "frm_csd_main", acNormal, , , , acWindowNormal
qry = "SELECT * FROM tbl_file_plans_divs WHERE (([tbl_file_plans_divs]![Division]=4));"
Case 5
DoCmd.OpenForm "frm_susd_main", acNormal, , , , acWindowNormal
qry = "SELECT * FROM tbl_file_plans_divs WHERE (([tbl_file_plans_divs]![Division]=5));"
Case 6
DoCmd.OpenForm "frm_rsad_main", acNormal, , , , acWindowNormal
qry = "SELECT * FROM tbl_file_plans_divs WHERE (([tbl_file_plans_divs]![Division]=6));"
End Select
End Sub