Hi, I'm trying to place the value of one field in a table into another field in another table in the same set. Below is the script I'm using:
dim Tbl as P
dim user1 as C
dim begindate as D
dim enddate as D
tbl3 = set.open("ameagle")
tstr1 = ui_get_text("Server Name","Please Enter a Server's Name")
if tstr1=""then
end
end if
user1=(tstr1)
dstr = ui_get_date("Beginning Date?","How Far Back Do You Wish To Go")
if dstr=""then
end
end if
begindate=ctod(dstr)
dstr1 = ui_get_date("Drop Dead Date","Please Enter Drop Dead Date")
if dstr=""then
end
end if
enddate=ctod(dstr1)
'debug(1)
tbl = table.current()
query.description = ""
query.order = ""
query.filter = "AMEREGL3->SERVER = "+quote(user1)+" .AND. BETWEEN(AMEREGL3->DROP_DEAD,{"+dtoc(begindate)+"},{"+dtoc(enddate)+"}) .AND. ISBLANK(\"AMEREGL3->DATE_COMP\")"
query.options = "I"
tbl.query_create()
tbl.fetch_first()
while .not. tbl.fetch_eof()
tbl.change_begin()
ameregl3->server_email = CASE(server list = marked(),server list->email)
tbl.change_end()
tbl.fetch_next()
end while
:form.activate("ameagle_new")
END
In the table.change_begin area is where I'm trying to call the marked records. Ameregl3 and Server list are both tables within the same set and ameregl3 is the parent table. The script is spawned in a new session and is run from a button on our main menu. Basically, I want to take the value in the Server List Email field and write it to the Server_Email field within ameregl3. There are no warnings or errors, it just doesn't write the email address into ameregl3. I'm sure it's my application of code but it seems to me this should work. Any help would be greatly appreciated. I'm leaving the office now but will be back tommorrow morning at 11:00 am (PST).
Thanks.....
Scott
dim Tbl as P
dim user1 as C
dim begindate as D
dim enddate as D
tbl3 = set.open("ameagle")
tstr1 = ui_get_text("Server Name","Please Enter a Server's Name")
if tstr1=""then
end
end if
user1=(tstr1)
dstr = ui_get_date("Beginning Date?","How Far Back Do You Wish To Go")
if dstr=""then
end
end if
begindate=ctod(dstr)
dstr1 = ui_get_date("Drop Dead Date","Please Enter Drop Dead Date")
if dstr=""then
end
end if
enddate=ctod(dstr1)
'debug(1)
tbl = table.current()
query.description = ""
query.order = ""
query.filter = "AMEREGL3->SERVER = "+quote(user1)+" .AND. BETWEEN(AMEREGL3->DROP_DEAD,{"+dtoc(begindate)+"},{"+dtoc(enddate)+"}) .AND. ISBLANK(\"AMEREGL3->DATE_COMP\")"
query.options = "I"
tbl.query_create()
tbl.fetch_first()
while .not. tbl.fetch_eof()
tbl.change_begin()
ameregl3->server_email = CASE(server list = marked(),server list->email)
tbl.change_end()
tbl.fetch_next()
end while
:form.activate("ameagle_new")
END
In the table.change_begin area is where I'm trying to call the marked records. Ameregl3 and Server list are both tables within the same set and ameregl3 is the parent table. The script is spawned in a new session and is run from a button on our main menu. Basically, I want to take the value in the Server List Email field and write it to the Server_Email field within ameregl3. There are no warnings or errors, it just doesn't write the email address into ameregl3. I'm sure it's my application of code but it seems to me this should work. Any help would be greatly appreciated. I'm leaving the office now but will be back tommorrow morning at 11:00 am (PST).
Thanks.....
Scott
Comment