>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
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