Hi
I have this code which worked fine in Access 97 - now we're using Access 2002 it doesn't ! and it doesn't like me trying to manipulate the subform on the fly, as per the last 3 lines of the code below
anybody know why ?
regards
ian
i.e. can't change the linkchildfields and linkmasterfields or set its control source
DoCmd.openform stDocName, , , stLinkCriteria, acFormEdit
Forms!frmactions_TRAINING!frmTRAIN_links.SourceObject = "frmTRAIN_links"
Forms!frmactions_TRAINING!frmTRAIN_links.Requery
Forms!frmactions_TRAINING!Command272.Enabled = False
Forms!frmactions_TRAINING!Command987.Enabled = True
Forms!frmactions_TRAINING!Command1022.Enabled = True
Forms!frmactions_TRAINING!Ref.ControlSource = "Ref"
Forms!frmactions_TRAINING!saref.ControlSource = "saref"
Forms!frmactions_TRAINING!Type.ControlSource = "Type"
Forms!frmactions_TRAINING!directorate.ControlSource = "directorate"
Forms!frmactions_TRAINING!counter.ControlSource = "counter"
Forms!frmactions_TRAINING!new_service.ControlSource = "new_service"
Forms!frmactions_TRAINING!TRAIN_cost.ControlSource = "TRAIN_cost"
str = "SELECT TRAIN_type, TRAINstatus from tblactions where saref = '" & Forms!frmactions_TRAINING!saref & "'"
Set rst = db.OpenRecordset(str)
Forms!frmactions_TRAINING!Frame988.ControlSource = "TRAINstatus"
Forms!frmactions_TRAINING!Frame988 = Val(rst("TRAINstatus"))
'Forms!frmactions_TRAINING!Frame988 = 2
Forms!frmactions_TRAINING!TRAIN_CompDate.ControlSource = "TRAIN_CompDate"
str1 = "SELECT TRAIN_type, TRAINstatus from tblactions where saref = '" & Forms!frmactions_TRAINING!saref & "'"
Set rst = db.OpenRecordset(str1)
Forms!frmactions_TRAINING!Frame1001.ControlSource = "TRAIN_type"
Forms!frmactions_TRAINING!Frame1001 = Val(rst("TRAIN_type"))
Forms!frmactions_TRAINING!action_desc.ControlSource = "action_desc"
Forms!frmactions_TRAINING!TRAINcat.ControlSource = "TRAINcat"
Forms!frmactions_TRAINING!TRAINsub.ControlSource = "TRAINsub"
Forms!frmactions_TRAINING!contra.ControlSource = "contra"
Forms!frmactions_TRAINING!monitor.ControlSource = "monitor"
Forms!frmactions_TRAINING!shared.ControlSource = "shared"
Forms!frmactions_TRAINING!TRAIN_FinalEval.ControlSource = "TRAIN_FinalEval"
Forms!frmactions_TRAINING!EmpNo.ControlSource = "EmpNo"
Forms!frmactions_TRAINING!employee.ControlSource = "employee"
Forms!frmactions_TRAINING!Command270.Caption = "Save Record"
Forms!frmactions_TRAINING!Command270.ForeColor = 16711680
Forms!frmactions_TRAINING!frmTRAIN_links.ControlSource = "SELECT tblPAIS_links.Ref, tblPAIS_links.ID_link, tblPAIS_links.PAIS_SECT, tblPAIS_links.SECT_PAIS, tblPAIS_links.desc1, tblPAIS_links.SECT_link FROM tblPAIS_links WHERE (((tblPAIS_links.Ref)=forms!frmactions_TRAINING!Ref))"
' Forms!frmactions_TRAINING!frmTRAIN_links.LinkMasterFields = "Ref"
' Forms!frmactions_TRAINING!frmTRAIN_links.LinkChildFields = "Ref"
I have this code which worked fine in Access 97 - now we're using Access 2002 it doesn't ! and it doesn't like me trying to manipulate the subform on the fly, as per the last 3 lines of the code below
anybody know why ?
regards
ian
i.e. can't change the linkchildfields and linkmasterfields or set its control source
DoCmd.openform stDocName, , , stLinkCriteria, acFormEdit
Forms!frmactions_TRAINING!frmTRAIN_links.SourceObject = "frmTRAIN_links"
Forms!frmactions_TRAINING!frmTRAIN_links.Requery
Forms!frmactions_TRAINING!Command272.Enabled = False
Forms!frmactions_TRAINING!Command987.Enabled = True
Forms!frmactions_TRAINING!Command1022.Enabled = True
Forms!frmactions_TRAINING!Ref.ControlSource = "Ref"
Forms!frmactions_TRAINING!saref.ControlSource = "saref"
Forms!frmactions_TRAINING!Type.ControlSource = "Type"
Forms!frmactions_TRAINING!directorate.ControlSource = "directorate"
Forms!frmactions_TRAINING!counter.ControlSource = "counter"
Forms!frmactions_TRAINING!new_service.ControlSource = "new_service"
Forms!frmactions_TRAINING!TRAIN_cost.ControlSource = "TRAIN_cost"
str = "SELECT TRAIN_type, TRAINstatus from tblactions where saref = '" & Forms!frmactions_TRAINING!saref & "'"
Set rst = db.OpenRecordset(str)
Forms!frmactions_TRAINING!Frame988.ControlSource = "TRAINstatus"
Forms!frmactions_TRAINING!Frame988 = Val(rst("TRAINstatus"))
'Forms!frmactions_TRAINING!Frame988 = 2
Forms!frmactions_TRAINING!TRAIN_CompDate.ControlSource = "TRAIN_CompDate"
str1 = "SELECT TRAIN_type, TRAINstatus from tblactions where saref = '" & Forms!frmactions_TRAINING!saref & "'"
Set rst = db.OpenRecordset(str1)
Forms!frmactions_TRAINING!Frame1001.ControlSource = "TRAIN_type"
Forms!frmactions_TRAINING!Frame1001 = Val(rst("TRAIN_type"))
Forms!frmactions_TRAINING!action_desc.ControlSource = "action_desc"
Forms!frmactions_TRAINING!TRAINcat.ControlSource = "TRAINcat"
Forms!frmactions_TRAINING!TRAINsub.ControlSource = "TRAINsub"
Forms!frmactions_TRAINING!contra.ControlSource = "contra"
Forms!frmactions_TRAINING!monitor.ControlSource = "monitor"
Forms!frmactions_TRAINING!shared.ControlSource = "shared"
Forms!frmactions_TRAINING!TRAIN_FinalEval.ControlSource = "TRAIN_FinalEval"
Forms!frmactions_TRAINING!EmpNo.ControlSource = "EmpNo"
Forms!frmactions_TRAINING!employee.ControlSource = "employee"
Forms!frmactions_TRAINING!Command270.Caption = "Save Record"
Forms!frmactions_TRAINING!Command270.ForeColor = 16711680
Forms!frmactions_TRAINING!frmTRAIN_links.ControlSource = "SELECT tblPAIS_links.Ref, tblPAIS_links.ID_link, tblPAIS_links.PAIS_SECT, tblPAIS_links.SECT_PAIS, tblPAIS_links.desc1, tblPAIS_links.SECT_link FROM tblPAIS_links WHERE (((tblPAIS_links.Ref)=forms!frmactions_TRAINING!Ref))"
' Forms!frmactions_TRAINING!frmTRAIN_links.LinkMasterFields = "Ref"
' Forms!frmactions_TRAINING!frmTRAIN_links.LinkChildFields = "Ref"