Hi,
The main form in my ExemptionDB contains three subforms which are controled by a drop-down list called ExemptionType.
Each subform relate to individual tables ExemptionAccount, ExemptionFirewall and tblExemptionRemoteAccess. And each of the three tables have a one-to-one relationship (Type 1) with the exemption table and the ExemptionID.
Only one subform are visible at a time and it is controled by a drop-down list on the mainform (see below.
Now my problem is I want a subform to be deleted if you decide to change value in the drop-down list i.e. there should only be information in one subform per ExemptionID.
How would I best achive this?
----------------------------------------------------------
Sub ShowSubform()
'Save unsaved changes to currently open subform
'DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'Display appropriate subform based on ExemptionTypeID chosen
If Me.ExemptionType.Value = "Account" Then
Me.subfrmExemptionAccount.Visible = True
Me.subfrmExemptionFirewall.Visible = False
Me.subfrmExemptionRemoteAccess.Visible = False
ElseIf Me.ExemptionType.Value = "Firewall" Then
Me.subfrmExemptionFirewall.Visible = True
Me.subfrmExemptionAccount.Visible = False
Me.subfrmExemptionRemoteAccess.Visible = False
ElseIf Me.ExemptionType.Value = "Remote Access" Then
Me.subfrmExemptionRemoteAccess.Visible = True
Me.subfrmExemptionFirewall.Visible = False
Me.subfrmExemptionAccount.Visible = False
Else
Me.subfrmExemptionAccount.Visible = False
Me.subfrmExemptionFirewall.Visible = False
Me.subfrmExemptionRemoteAccess.Visible = False
End If
--------------------------------------------------
Thanks in advance!!!
Regards,
The main form in my ExemptionDB contains three subforms which are controled by a drop-down list called ExemptionType.
Each subform relate to individual tables ExemptionAccount, ExemptionFirewall and tblExemptionRemoteAccess. And each of the three tables have a one-to-one relationship (Type 1) with the exemption table and the ExemptionID.
Only one subform are visible at a time and it is controled by a drop-down list on the mainform (see below.
Now my problem is I want a subform to be deleted if you decide to change value in the drop-down list i.e. there should only be information in one subform per ExemptionID.
How would I best achive this?
----------------------------------------------------------
Sub ShowSubform()
'Save unsaved changes to currently open subform
'DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'Display appropriate subform based on ExemptionTypeID chosen
If Me.ExemptionType.Value = "Account" Then
Me.subfrmExemptionAccount.Visible = True
Me.subfrmExemptionFirewall.Visible = False
Me.subfrmExemptionRemoteAccess.Visible = False
ElseIf Me.ExemptionType.Value = "Firewall" Then
Me.subfrmExemptionFirewall.Visible = True
Me.subfrmExemptionAccount.Visible = False
Me.subfrmExemptionRemoteAccess.Visible = False
ElseIf Me.ExemptionType.Value = "Remote Access" Then
Me.subfrmExemptionRemoteAccess.Visible = True
Me.subfrmExemptionFirewall.Visible = False
Me.subfrmExemptionAccount.Visible = False
Else
Me.subfrmExemptionAccount.Visible = False
Me.subfrmExemptionFirewall.Visible = False
Me.subfrmExemptionRemoteAccess.Visible = False
End If
--------------------------------------------------
Thanks in advance!!!
Regards,