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

On 11/16/2023 10:58 AM, charlie wrote:
> tHANKS kEN..  i HOPE YOUR WIFE IS OK.
>
> 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
program?

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

--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm
dBASE DOS to Windows Tutorial:
http://www.goldenstag.net/dbase/DtoWTutorial/00_Menu.htm