How to update a table with an unbound text box on a form?

Hi everyone,

I have a table called RUNDTE.  This table has two columns, SPEC and SET.  SPEC allows me to select a date on a form I've created called RUNDTEf.  I have an unbound textbox on the RUNDTEf form that has this control source:  Format([SPEC],"\1yymmdd").

I need the result in this textbox to update to my RUNDTE table.  Anyone know how I can do this?
LVL 1
Anthony6890Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
You can use the Form Before Update event, like so.

Is SPEC the field you want to update ?  Example below assumes that. Also, plug in the actual Name of your textbox.

Private Sub Form_BeforeUpdate (Cancel As Integer)

Me![SPEC] = Me.YourTextBoxName

End Sub
0
Anthony6890Author Commented:
No, I want to update CONVERTED.  

Where am I putting this code?
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
You put this code in the Form Before Update Event, which will look like this:

Private Sub Form_BeforeUpdate (Cancel As Integer)

Me![CONVERTED] = Me.YourTextBoxName

End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
see image.

mx
Capture1.gif
0
Anthony6890Author Commented:
That worked great!

Thanks for all your help.

-Anthony
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Sure.  Note that in general, it's not usually recommended to store a calculated field, unless you have a very specific reason to do so, because usually ... you can recreate that calc on the fly in query, report, form, by using the same calculation ...

Just a FYI ...

mx
0
Anthony6890Author Commented:
Thanks for the info.  Yeah there is a specific reason that I needed it to work this way, but thanks for the fyi...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.