Click to See Complete Forum and Search --> : inserting .gif image


andy symmons
September 13th, 2001, 05:40 AM
i have a form with a text box on and would like to insert an image into it providing that the correct 4 digit number is typed in to the same textbox to start with. if the wrong 4 digit number is typed in, a msgbox to appear with a msg to say so, please help as this is very frustrating for a beginner like myself
thanx in advance


Thanks in advance for any help in this matter

Cakkie
September 13th, 2001, 06:55 AM
You can do this using a richtextbox control. Regular textboxes do not allow you to insert objects.

private Sub RichTextBox1_Change()

If len(RichTextBox1.Text) = 4 then
If Left(RichTextBox1.Text, 4) = "1234" then
RichTextBox1.SelStart = 0
RichTextBox1.SelLength = 4
RichTextBox1.OLEObjects.Add Source:="c:\1234.bmp"
RichTextBox1.SelStart = 1
End If
End If

End Sub




Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook

andy symmons
September 13th, 2001, 10:15 AM
Thanx for the solution, but there is only one snag, i don't think i can use a richtextbox control in access 97 which is the application that i am using for the rest of my project.
is there a way i can manipulate it for use with access?


Thanks in advance for any help in this matter

Cakkie
September 13th, 2001, 03:39 PM
You can use the richtextbox control in Access

On your workset (the thing with all the controls on), there's a button called 'more controls', when you press this, a list will pop up. Scrool down until you get to 'Microsoft Rich Textbox', select it, and drag it into the form

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook

andy symmons
September 14th, 2001, 03:16 AM
so obvious when someone tells you, thanks very much for your help
:)


Thanks in advance for any help in this matter

Alex Zhu
November 28th, 2001, 02:23 PM
I got a question on adding OLEObjects. When I do the following,
RichTextBox1.OLEObjects.Add Source:="c:\1234.bmp"
I got a shaking of the user interface and I can't
figure it why and can't figure a way to avoid it.

Any suggestions?

Thanks

Alex Zhu