Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Displaying fields from another table
Message
De
28/11/2003 02:05:42
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Displaying fields from another table
Divers
Thread ID:
00854140
Message ID:
00854140
Vues:
45
i have a form that displays employee's firstname and lastname form employee table.

actually this form is a data entry screen for employee leave. (i also have a separate table for leave which is leave.dbf)

the user will enter an employee no., then my form should be able to display the firstname and lastname from employee table.

so i do this in the refresh event of text1 (textbox to display the lastname and firstname of employee)


This.Value = alltrim(employee.firstname)+ " " + alltrim(employee.mid) + iif(alltrim(employee.mid)="","",". ") + alltrim(employee.lastname)


this code works fine with add and edit buttons except for the delete.

in my delete click event i have this,
set multilocks on
=cursorsetprop("buffering",5,"leave")
=tableupdate(.t.)
set multilocks on
=cursorsetprop("buffering",1,"leave")
thisform.delete()
set multilocks on
=cursorsetprop("buffering",5,"leave")
=tableupdate(.t.)
thisform.refresh()
if eof()
    thisform.text1.visible=.f.
    thisform.txtdesc.visible=.f.
endif
thisform.delete have this code,
if .not. eof()
    nanswer=messagebox("Are you sure you want to delete?",292,"Program Message")
    do case
    case nanswer=6
        dele
        gfile=juststem(dbf())

        use in &gfile
        use &gfile in 0 alias gfile exclusive
        select gfile
        pack
        use
        use &gfile in 0 shared

        messagebox("Record deleted!",64,"Program Message")
    endcase
else
    messagebox("No record to delete!",64,"Program Message")
endif
the delete works fine too except that it seems not to refresh text1, which should display the firstname and lastname of the employee.

what should i do? any help pls?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform