A host-guest inclusion compound [(DPA)(18-crown-6)]ClO4 (DPA = dipropylamine) undergoes a reversible phase transition at 214 K, which enables it to switch the NLO response between SHG-ON and SHG-OFF states associated with the order-disorder transition of the guest DPA cations and a slight tilting of the host 18-crown-6 molecules.