jhawkfan79
Apr 17 2007, 12:26 PM
Conditions...
1 Form with an unbound text box that I input a string like this: JA85YY777
After Update of the unbound text box, a macro fires with a setvalue
Setvalue contains a mid funciton to pull the "YY" from the inputted data and populate into a second unbound text box.
When I test the form, I continue to get "Type Mismatch" when it tries to set the value. Error message contains
[Forms]![frmNewLoc2]![txtID], Mid([Forms]![frmNewLoc2]![txtLocation],5,2)
Any ideas???
AC2Designs
Apr 17 2007, 02:12 PM
Do you have code in your txt controls that may be setting something to a variable?
Can you post the code associated with this Form?
If the controls are unbound then there should not be a problem unless you have some code behind them...
strive4peace
Apr 17 2007, 02:13 PM
instead of using a macro, put this on the control AfterUpdate event:
CODE
if isnull(controlname1) then exit sub
if len(me.controlname1) < 9 then
msgbox "required format is AA99YY999",,"Enter new code"
exit sub
end if
me.controlname_yy = Mid(me.controlname1,5,2)
How To Get Started Programming
http://www.utteraccess.com/forums/showflat...;Number=1230004