Update field1 from field2

esskaykay

Registered User.
Local time
Today, 08:47
Joined
Mar 8, 2003
Messages
267
I’d like some assistance on the following if possible:

I have a database where I want to update a field (Agree_ID) based on the data input in a second field (Pond_ID). Agree_ID uses only a portion of Pond_ID. I’d like some routine (macro or VBA code) to assist.

Example:
Pond_ID – keyin "05-04-1P"
Agree_ID – updates to "05-04"

I used “=Mid([Pond_ID],1,5)” to update Agree_ID which appears to work. However, I have to close the record; run a macro that runs the code; then go back into the form and open the record. I’d like this to happen automatically when I keyin the data in Pond_ID.

Any ideas would be greatly appreciated.
Thanks,
SKK
 
Just off the top of my head, instead of setting the value to “=Mid([Pond_ID],1,5)" i would write some vb code to do it. setup an event on your control with soemthing like

agreeid.value = mid(pondid.value, 1, 5)
 
You could always, rather closing and reponing the form, call the Recalc method which will immediately update all calculated controls on the form.
 
Let me try these guys. I'll keep you posted.

Thanks,
SKK
 

Users who are viewing this thread

Back
Top Bottom