Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid displaying last record - refresh problem
Message
De
27/09/1999 04:03:50
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
25/09/1999 21:27:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00269015
Message ID:
00269216
Vues:
26
>Hello:
>I have a form(A) that calls another form(B) for users to input
>client information. They search by sin number and in the valid of that text box there is code to search the client table if it's there and display, if it's not there the user must add the client(firstname,lastname and phone number)
>
>Form b has 5 textbox controls, 3 which use variables(csurname, cfirstname and cphone and 2(gidetail.sin, gidetail.result) are the fields in the table as the controlsource. These are saved and to display in a grid on Form A.
>
>When I add my first record everthing displays fine, when I add the second record, the values in the columns that use the fields as the contolsource are fine but the other columns(variables) display record
>2's name and phone#, if I add a third , rec # 1,2 &3 display the name entered for record 3's name....etc. So bascially the last record input on form B is what's displaying for all my records in the
>grid but just in the fields that use a variable as the controlsource,
>
>I've tried copying my data to an array and using this as the control
>source but I get the same result.
>
>In the valid of the textbox(csurname)I have the following:
>
>
>If thisform.text2.enabled = .t.
> replace client.surname with this.value
>this.refresh
>Endif
>
>Why is this changing all my records and placing the last
>record input in for all name's and phone number and keeping the other
>2 fields correct values?
>
>It is only a display problems as it is updating the table correctly.
>Any advice would be appreciated. THanks.


Sheena,
It's normal. It's like having n textboxes with same memvar as controlsource. Whatever the memvar value that would be displayed in column. You could use an array instead. ie:
select mytable.Title from myTable into array thisform.aTitles
thisform.mygrid.mycolumn.controlsource = "thisform.aTitles[recno(),1]"

IMHO better is using a calculated controlsource or cursor. For calculated, controlsource might be :
Thisform.GetThisRecSurname(gidetail.sin)

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform