M
m44pablo
Have 2 command buttons that open 1 form.
First button opens fine with the specied recordsource but
the other one comes up with
"Runtime error 2001
You canceled the previous operation."
code as follows:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmOrgSurveyModule"
stLinkCriteria = "[Org_seqno]=" & "'" & Me![Org_seqno]
& "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
If IsFormLoaded("frmOrganization") = True Then
Forms!frmOrgsurveymodule.txtorg_seqno = Me.Org_seqno
Forms!frmOrgsurveymodule.Label1.Caption = "PEP
CONSULTANT IMPLEMENTATION SURVEY"
Forms!frmOrgsurveymodule.lblSurveyMonth.Visible =
True
Forms!frmOrgsurveymodule.frmSurveyMonth.Enabled =
True
Forms!frmOrgsurveymodule.frmSurveyMonth.Locked =
False
Forms!frmOrgsurveymodule.frmSurveyMonth.Visible =
True
Forms!frmOrgsurveymodule.RecordSource = "select *
from tblorgsurveymodule where survey_mo in (3,6,9,12)"
End If
if I try to debug it - just highlight the recordsource.
Can't figure this out!!!
I need to change the recordsource if the other button is
pressed.
Help.
Thanks.
First button opens fine with the specied recordsource but
the other one comes up with
"Runtime error 2001
You canceled the previous operation."
code as follows:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmOrgSurveyModule"
stLinkCriteria = "[Org_seqno]=" & "'" & Me![Org_seqno]
& "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
If IsFormLoaded("frmOrganization") = True Then
Forms!frmOrgsurveymodule.txtorg_seqno = Me.Org_seqno
Forms!frmOrgsurveymodule.Label1.Caption = "PEP
CONSULTANT IMPLEMENTATION SURVEY"
Forms!frmOrgsurveymodule.lblSurveyMonth.Visible =
True
Forms!frmOrgsurveymodule.frmSurveyMonth.Enabled =
True
Forms!frmOrgsurveymodule.frmSurveyMonth.Locked =
False
Forms!frmOrgsurveymodule.frmSurveyMonth.Visible =
True
Forms!frmOrgsurveymodule.RecordSource = "select *
from tblorgsurveymodule where survey_mo in (3,6,9,12)"
End If
if I try to debug it - just highlight the recordsource.
Can't figure this out!!!
I need to change the recordsource if the other button is
pressed.
Help.
Thanks.