Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

macro variable in fieldname of table 1

Status
Not open for further replies.

foxup

Programmer
Dec 14, 2010
328
CA
Hi,

This should seem simple enough but for some reason, the replace is not being done and I'm not even getting an error either. I have a commandbutton on my form. In the "click" of the commandbutton I have this:
QTYI="QTY_ITEM"+ALLTRIM(STR(addctr))
QDES="DESCITEM"+ALLTRIM(STR(addctr))
QTYP="TYPEITEM"+ALLTRIM(STR(addctr))
QUPR="UPRCITEM"+ALLTRIM(STR(addctr))
SELECT intercon_quotes
REPLACE intercon_quotes.&QTYI WITH THISFORM.spinner1.VALUE
REPLACE intercon_quotes.&QDES WITH THISFORM.EDIT1.VALUE
REPLACE intercon_quotes.&QTYP WITH THISFORM.COMBO1.VALUE
REPLACE intercon_quotes.&QUPR WITH THISFORM.TEXT1.VALUE
as mentionned, for some reason, nothing is being 'replaced" and I don;t even get an error.

Note, in my form, I have: spinner1, edit1, combo1, text1


What am I not seeing?

Please help.


Thanks,
FOXUP




 
Try this:
Code:
QTYI="QTY_ITEM"+ALLTRIM(STR(addctr))
QDES="DESCITEM"+ALLTRIM(STR(addctr))
QTYP="TYPEITEM"+ALLTRIM(STR(addctr))
QUPR="UPRCITEM"+ALLTRIM(STR(addctr))

SELECT intercon_quotes
REPLACE &QTYI. WITH THISFORM.spinner1.VALUE,;
        &QDES. WITH THISFORM.EDIT1.VALUE,;
        &QTYP. WITH THISFORM.COMBO1.VALUE,;
        &QUPR. WITH THISFORM.TEXT1.VALUE IN intercon_quotes

Borislav Borissov
VFP9 SP2, SQL Server
 
Hi Boris,

It still didn;t work. Very odd. It does say "1 replacement" on the bottom status bar but in the table, the values are not there. Any suggestions?


Thanks,
FOXUP
 
You are at EOF() or BOF() of the intercon_quotes?

Borislav Borissov
VFP9 SP2, SQL Server
 
Ahh man. I knew it was something stupid like that. Yeah, that was the problem (I was on 'EOF'). Thank You Boris. Star for you.


Thanks,
FOXUP!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top