PDA

Click to See Complete Forum and Search --> : Text box question


hlieu
Jul 27th, 2000, 11:07 AM
Hello,

I have a textbox that bounded to the field called Email(Access 97 table). The field Email contains a line of text "SMTP:staff@temposchool.org%X400:c=US".

My question is: Is it possible to have the texbox to populate only partial of the contain in the field Email "staff@temposchool.org"?

Thank you in advance

JHausmann
Jul 27th, 2000, 11:22 AM
You could hide the bound text field, create an un-bound field and place it directly on top of the hidden field and then, in code, move/format the data to the unbound field

hlieu
Jul 27th, 2000, 12:11 PM
Hi JHausmann,

Can you please give a sample(code) how to move/format the data to the unbound field.

Thank you.

JHausmann
Jul 27th, 2000, 12:41 PM
Using the example you provided, you'd want to :



dim sTemp as string
dim sTemp2 as string


sTemp = form.boundfield.text

'get rid of prefix, if it always starts with "SMTP:"
sTemp2 = right(sTemp,len(sTemp)-5)

'get rid of suffix, if it always starts with "%"
sTemp = sTemp2
if instr(1,sTemp2,"%") > 0 then
sTemp = left(sTemp2,instr(1,stemp,"%")-1)
end if

'set the value in the un-bound field
form.unboundfield.text=sTemp

hlieu
Jul 27th, 2000, 06:36 PM
Thank you very much for your help JHausmann