Saving field on unbound form after changes

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
 
A

Adrian Jansen

Yes, just found this out for myself. Thanks for the confirmation.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top