Subject Re: Variable used for the field in code?
From Ken Mayer <>
Date Thu, 16 Nov 2023 12:40:03 -0800
Newsgroups dbase.getting-started

On 11/16/2023 10:58 AM, charlie wrote:
> I couldn't get it to work but used endif statements instead which does work.  But it does take a lot if text.

Thanks, my wife is having fun with her eye (cataract surgery, lens that
was put in three years ago is becoming detached ... sheesh). More
surgery in the future, fun.

Okay. Well, let me take a look. I know it should be doable ...

The biggest issue is that as soon as you open the form in the form
designer, any memory variables will be evaluated, and changed to their
actual values. Is this something you are trying to do in a form, or in a

Try changing the code to use the following -- it's using macro expansion
to put the fieldname into the location (note you need the ampersand (&)
and dot (.) characters there):

form.spinboxestv1.value = val(co.fields["&grd."].value)


*Ken Mayer*
Ken's dBASE Page:
The dUFLP:
dBASE Books:
dBASE Tutorial:
dBASE Web Tutorial:
dBASE DOS to Windows Tutorial: