A
Adrian Jansen
Using Access 2002.
I have an unbound form, used to set up some user preferences, and saving
them in the Windows Registry with the SaveSettings command. At one point I
want to show another textbox, and then hide it when the setting has been
saved, so I have code like:
Private Sub txtBackendDefault_BeforeUpdate(Cancel As Integer)
SaveSetting "MyDB", "EditOptions", "DefaultBackend",
Me.txtBackendDefault.Value
Me.txtOther.Visible = True
Me.txtOther.SetFocus
Me.txtBackendDefault.Visible = False
Me.Label21.Caption = "Default saved"
End Sub
But when I edit the field in txtBackendDefault and then tab or otherwise
leave the field, I get a runtime error 2108, "Cannot set focus to another
field until the record is saved."
Since this is an unbound field, how do I save the record, or at least bypass
the error. I tried doing an On error resume next, but the field
txtBackendDefault remains visible, presumably because the setfocus command
fails.
--
Regards,
Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
I have an unbound form, used to set up some user preferences, and saving
them in the Windows Registry with the SaveSettings command. At one point I
want to show another textbox, and then hide it when the setting has been
saved, so I have code like:
Private Sub txtBackendDefault_BeforeUpdate(Cancel As Integer)
SaveSetting "MyDB", "EditOptions", "DefaultBackend",
Me.txtBackendDefault.Value
Me.txtOther.Visible = True
Me.txtOther.SetFocus
Me.txtBackendDefault.Visible = False
Me.Label21.Caption = "Default saved"
End Sub
But when I edit the field in txtBackendDefault and then tab or otherwise
leave the field, I get a runtime error 2108, "Cannot set focus to another
field until the record is saved."
Since this is an unbound field, how do I save the record, or at least bypass
the error. I tried doing an On error resume next, but the field
txtBackendDefault remains visible, presumably because the setfocus command
fails.
--
Regards,
Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control