Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Manupulating record fields
Message
 
To
13/06/1998 16:15:13
Tan Gay Cheong
Cybercomp Computer Services
Singapore, Singapore
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00107808
Message ID:
00108062
Views:
43
>Ok assuming I have a form. There are four textboxes.
>
>Textbox1's control source = instal.date_commence (date variable)
>Textbox2's control source = instal.numinstal (numeric variable)
>Textbox3's control source = instal.d_date1 (date variable)
>Textbox4's control source = instal.d_date2 (date variable)
>
>3 tables in pemissistic row buffering in the data environment of the form. form using private datasession.
>
>In actual fact there are d_date1 to d_date48 fields in the record. What can I do to make instal.d_date1 replace with the date_commence and an increament by one month depending on the instal.numinstal?
>
>Hope I am not too confussing.

Tan, I'm assuming you want to update these fields from the valid() method for Textbox1. Use the code in my previous message (Click MAP, below, look for my message 6/13/97, 15:07, Message # 107897). This loop will go through each of your date fields replacing the value in the table. Then call thisform.refresh (or a page refresh if you are in a pageframe).
dNewDate = this.value    && the value of Textbox1, date_commence
 for i=1 to 20
    lcFieldName = "d_date" + alltrim(str(i))
    replace &lcFieldName with gomonth(dNewDate, i-1)
 endfor
Note that the call to gomonth(dNewDate, i-1) uses "i-1" because you want the d_date1 field to have the same value as date_commence.

Obviously, you can adjust this code to include calls to instal.numinstal or any other information.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform