I have a database in Visual Fox and I want to display an image depending on a field. For example, for the table 'player', for each player to display an different image. Please explain me how to do this! I'm a begginer in this program. Thanks a lot!
ok..but how can I do that? I tried to do a general field, but if I try to do a report it appears the adress, not the image. Please explain step by step.
I also tried to do a memo field, or a character field and to use the function strtofile() but it appears an error [when I wrote strtofile(tablename.field) it appeared :"too few arguments"].
If it's a report, you first need to add a field to hold the path and filename of the image. Add that to the table or cursor that drives the report.
Next, drop a Picture/OLE Bound control on the report.
Right-click on the Picture/OLE Bound control, and select Properties. In the properties dialogue, set "Control Source Type" to "Expression or Variable Name", and set the Control Source to the field that contains the filename.
If you are doing something other than a report, please explain what you are tying to do.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Thanks a lot! I was trying to do a report. It's my bad I didn't mentioned that. I succeed in doing a report, but if you want to explain me how to do a form also, I will be grateful.
Well, I did so, but I could perhaps elaborate a little more.
As always there is more than one way, but as you are now with filenames in your data, assume your table is called "players" and has a field named "picture" in it, you show one record in an image control by setting the imagecontrol picture property to players.picture.
An image control has no controlsource, so you need to program that line "image1.picture = players.picture" somewhere in a method you run, when the record changes, eg in a skip button in it's click.
Are you using the form wizards to create your forms?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.