Hello,
Below is the use case of my access forms.
I have 2 forms
Form 1: I pull few fields from SQL and store them in a recordset.
Below is the query
Code:
Private Sub btn_EDIT_EMPLOYEE_INFO_Click()
Dim strSQL As String
Dim r As New ADODB.Recordset
Dim DC As New DataConnection
strSQL = "SELECT P.REP_ID, P.FIRST_NAME, P.LAST_NAME, P.CURRENT_MEMBER, P.DATE_ADDED, " & _
"P.DATE_REMOVED, P.PREFERRED_FULL_NAME, P.EMAIL_ADDRESS, A.REASON_ADDED, R.REASON_REMOVED " & _
"FROM (TableA AS P LEFT JOIN TableX AS A ON P.REASON_ADDED = A.ID) LEFT JOIN " & _
"TableY AS R ON P.REASON_REMOVED = R.ID WHERE P.REP_ID = '" & Me.REP_ID & "' ;"
r.Open strSQL, DC.CPS_DATA, adOpenKeyset, adLockOptimistic
DoCmd.OpenForm "frm_CPS_EDIT"
Set Forms("frm_CPS_EDIT").Recordset = r
Forms("frm_CPS_EDIT").Requery
Call Form_frm_CPS_EDIT.ACTIVATE_DEACTIVATE_STATUS
DoCmd.Close acForm, "DASHBOARD", acSaveNo
End Sub
So I store the values coming from strsql into 'r' recordset and then set those values for the form 'frm_CPS_EDIT'.
Now since this is a button click function, when I click that button, it will open the DoCmd.OpenForm "frm_CPS_EDIT"
But there seems to be an error coming on 'Call Form_frm_CPS_EDIT.ACTIVATE_DEACTIVATE_STATUS'.
Error: Runtime error '13'
Reserved Error.
Few additional Information::
the Form 2 is the == frm_CPS_EDIT
I check the function call for the ACTIVATE_DEACTIVATE_STATUS
Code:
Public Sub ACTIVATE_DEACTIVATE_STATUS()
Dim STR_ACTIVATE_DEACTIVATE As String
If Me.ACTIVE_MEMBER_TXT = "YES" Then
STR_ACTIVATE_DEACTIVATE = "DEACTIVATE"
Else: STR_ACTIVATE_DEACTIVATE = "ACTIVATE"
End If
Me.btn_ACTIVATE_DEACTIVATE.Caption = STR_ACTIVATE_DEACTIVATE & " THIS EMPLOYEE"
End Sub
Code for the logic of ACTIVE_MEMBER_TXT
Code:
=IIf([CURRENT_MEMBER]=1,"YES","NO")
CURRENT_MEMBER is a checkbox which I believe is coming from the P.CURRENT_MEMBER column from strsql.
MY questions is :
How do i start debugging this issue?
What could be the cause of this issue?
Thanks!