The problem I am having is inserting the option button group value into SQL server table. Below is the code. The problem area is under comment 'Insert a new record and create a new query for CPA Table.
I'm not that savvy with programming. Any help will be appreciated. Thanks.
Private Sub Continue1_button_Click()
On Error GoTo Err_Continue1_button_Click
Dim stDocName As String
Dim stLinkCriteria As String
'Validates Option Buttons have been chosen
If Me.Frame1.Value = 0 Then
MsgBox "Please recheck answer(s) to ensure option button was selected."
'Me.Frame1.BackColor = RGB(255, 0, 0)
Exit Sub
End If
'Insert a new record and create a new query for CPA Table
DoCmd.RunSQL "Insert into CPA (Q1) values ( Me.Frame1 );"
strSQL = "Select Q1 from CPA where ID = " & GBL_ID & " ;"
stDocName = "CPA_form_2"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Continue1_button_Click:
Exit Sub
Err_Continue1_button_Click:
MsgBox Err.Description
Resume Exit_Continue1_button_Click
End Sub
I'm not that savvy with programming. Any help will be appreciated. Thanks.
Private Sub Continue1_button_Click()
On Error GoTo Err_Continue1_button_Click
Dim stDocName As String
Dim stLinkCriteria As String
'Validates Option Buttons have been chosen
If Me.Frame1.Value = 0 Then
MsgBox "Please recheck answer(s) to ensure option button was selected."
'Me.Frame1.BackColor = RGB(255, 0, 0)
Exit Sub
End If
'Insert a new record and create a new query for CPA Table
DoCmd.RunSQL "Insert into CPA (Q1) values ( Me.Frame1 );"
strSQL = "Select Q1 from CPA where ID = " & GBL_ID & " ;"
stDocName = "CPA_form_2"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Continue1_button_Click:
Exit Sub
Err_Continue1_button_Click:
MsgBox Err.Description
Resume Exit_Continue1_button_Click
End Sub