![Image](http://i66.tinypic.com/2v9dpg7.jpg)
Una vez que cambio los datos, cambio también el action y el prompt del menú, al pulsarlo nuevamente se ve de esta manera.
![Image](http://i67.tinypic.com/2ms0sch.jpg)
Alguna pista ? Muchísimas gracias
Saludos
Code: Select all | Expand
//----------------------------------------------------------------------------//
Function PopupNoMat()
Local oMenu
Local oMnu := Array( 2, 0 )
Menu oMenu PopUp _2010
MenuItem oMnu[ 1 ] Prompt '&Tabla de históricos' Action If( !lHistorico, IrTablaHistoricos( oMnu ), IrTablaAlumnos( oMnu ) )
MenuItem oMnu[ 2 ] Prompt '&Enviar a históricos' Action If( !lHistorico, EnviaAHistoricos(), EnviaAAlumnos() )
EndMenu
Return oMenu
Code: Select all | Expand
//----------------------------------------------------------------------------//
Function IrTablaAlumnos( oMnu )
lHistorico := .f.
oMnu[ 1 ] : SetText( '&Tabla de históricos' )
oMnu[ 2 ] : SetText( '&Enviar a históricos' )
oQry : SetFilter( '' )
oQry : SetFilter( 'es_historico == 0' )
oBrw : GoTop()
oBrw : Refresh()
oBrw : SetFocus()
oWnd : SetText( 'Tabla Alumnos' )
Return 0
//----------------------------------------------------------------------------//
Function IrTablaHistoricos( oMnu )
lHistorico := .t.
oMnu[ 1 ] : SetText( '&Tabla alumnos' )
oMnu[ 2 ] : SetText( '&Enviar a padron actual' )
oQry : SetFilter( '' )
oQry : SetFilter( 'es_historico == 1' )
oBrw : GoTop()
oBrw : Refresh()
oBrw : SetFocus()
oWnd : SetText( 'Tabla Históricos' )
Return 0
Code: Select all | Expand
oMnu[ 01 ]:SetChangePrompt( "Nuevo Item" )
Code: Select all | Expand
Error description: Error BASE/1004 No existe el m‚todo: HWND
Args:
[ 1] = U
Stack Calls
===========
Called from: => HWND( 0 )
Called from: .\source\classes\MENUITEM.PRG => TMENUITEM:SETCHANGEPROMPT( 805 )
Called from: C:\t-rex_sql\alumnos.prg => IRTABLAHISTORICOS( 309 )
Called from: C:\t-rex_sql\alumnos.prg => (b)POPUPNOMAT( 286 )
Called from: .\source\classes\MENU.PRG => TMENU:ACTIVATE( 1270 )
Called from: .\source\classes\TRBTN.PRG => TRBTN:LBUTTONUP( 883 )
Called from: .\source\classes\TRBTN.PRG => TRBTN:LBUTTONDOWN( 799 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1718 )
Called from: .\source\classes\TRBTN.PRG => TRBTN:HANDLEEVENT( 1575 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1036 )
Called from: C:\t-rex_sql\main.prg => START( 104 )
Called from: C:\t-rex_sql\main.prg => MAIN( 12 )
Code: Select all | Expand
Menu oMenu PopUp _2010 OF oWnd // añade de momento OF <ventana>
Code: Select all | Expand
Menu oMenu PopUp _2010
MenuItem oMnu[ 1 ] Prompt { || if( !lHistorico, '&Tabla alumnos', '&Tabla de históricos' } Action If( !lHistorico, IrTablaHistoricos( oMnu ), IrTablaAlumnos( oMnu ) )
MenuItem oMnu[ 2 ] Prompt { || if( !lHistorico, '&Enviar a padron actual', '&Enviar a históricos' } Action If( !lHistorico, EnviaAHistoricos(), EnviaAAlumnos() )
EndMenu