It's easy to enter the wrong path or filename. To lessen the chance of error, call the Open Dialog box from Windows using the Utility("CHOOSEFILE") function, allowing the user to point and click the desired file. The path and the filename will be returned and automatically put in the picture field that holds the path and filename information.
Doing it this way will also give us the option to make the field invisible, because the path doesn't matter, only the picture.
Below is the form with a sample record:
Code this by following these steps:
Add a button (call it BUTTON_CHOOSE) to the form.
In its Click event, code the following:
This code calls the Utility("CHOOSEFILE") function to look for .jpg files in the default directory. If the user chooses a file, its path is set in the PICTURE control, which fires the Change event code illustrated in the previous topic.