1 (edited by shmutus 2021-11-22 13:07:02)

Topic: If error then

Hello again wizards,
I successfully created a simple form where when I enter a number in a textbox it shows me the corresponding Image jpg.
(If I enter "1" it shows me "1.jpg", if I enter "2" it shows me "2.jpg" etc...
When there is no corresponding jpg I get a program error.
How can I bypass the error and leave the image empty if no jpg is available?
Attached the project + Folder with 5 images (1-5.jpg).
Thank You.

Post's attachments

Attachment icon Image.zip 368.45 kb, 142 downloads since 2021-11-22 

Re: If error then

Hi,
Is there a reason why you are using the 'image' object rather than the 'dbimage' object?
Derek.

Re: If error then

derek wrote:

Hi,
Is there a reason why you are using the 'image' object rather than the 'dbimage' object?
Derek.

Well, I don't need to store the image in the database.

Re: If error then

If you don't want to store images in the actual database (and there are good reasons not to as the size of the database could quickly get very large), then you should set the dbimage1 'type' property to 'linkfile' and set the dbimage1 'copy to' property to be a discrete folder (local or networked) (see the screenshot in the attachment). 
When you do this, all that is stored is the link to the folder and file and so the database is kept small.
Derek.

Post's attachments

Attachment icon Save record and clear.zip 445.72 kb, 168 downloads since 2021-11-22 

Re: If error then

derek wrote:

If you don't want to store images in the actual database (and there are good reasons not to as the size of the database could quickly get very large), then you should set the dbimage1 'type' property to 'linkfile' and set the dbimage1 'copy to' property to be a discrete folder (local or networked) (see the screenshot in the attachment). 
When you do this, all that is stored is the link to the folder and file and so the database is kept small.
Derek.

Thank You Derek,
I'm sorry I didn't explain myself so good.
I do not wish to choose the image from disk, I just wish to see it when I type the same number, just as it is working in the zip I sent.
Attached is a demo video of how it works & this is great for me.
The only thing I want to learn is how to bypass the error message when an image is not available for the typed number.
I guess its an "if else" but I don't know how to do it.

Post's attachments

Attachment icon demo.mp4 137.32 kb, 146 downloads since 2021-11-22 

Re: If error then

Привет, ДЕРЕК !!

shmutus, попробуйте этот вариант

Post's attachments

Attachment icon Image.rar 174.01 kb, 172 downloads since 2021-11-22 

Re: If error then

sibprogsistem wrote:

Привет, ДЕРЕК !!

shmutus, попробуйте этот вариант

PERFECT! THANK YOU!