Adding text to a text field After Update

Rusty

Registered User.
Local time
Today, 22:42
Joined
Apr 15, 2004
Messages
207
Hi Guys,

I have a text field on a form and after the user has entered in some data I want to put some VBA in there so it will add the text ".jpg" to the end of it.

Any help on this would be greatly appreciated.

Cheers,

Rusty
:D
 
Can you put something like this:

me.textbox.value = me.textbox.value & ".jpg"

That should work I think.
 
Thanks for that, it worked a treat...

But when I delete the text in the field of an existing record, and want to leave it blank, it still adds the ".jpg". Any ideas on stopping this from happening and leaving my field "null"?

Thanks,

Rusty
:D
 
if len(me.textbox.value) <> 0 then me.textbox.value = me.textbox.value & ".jpg"


Try this instead.
 
That cracked it - thanks for the help!!
 
Code:
If Not IsNull(Me.MyTextBox) Then Me.MyTextBox = Me.MyTextBox & ".jpg"

The .Value property is the default property for the textbox object and, if you reference no other property, the .Value is taken as given meaning that you don't need to include it.
 
Code:
If Not IsNull(Me.MyTextBox) Then Me.MyTextBox = Me.MyTextBox & ".jpg"

The .Value property is the default property for the textbox object and, if you reference no other property, the .Value is taken as given meaning that you don't need to include it.
 
Yeah, I couldn't remember if I could leave it out or not so I just left the ".value" in there. Thanks for clarifying that.
 

Users who are viewing this thread

Back
Top Bottom