IF !tlEdit lcDate=DTOC(calDate(tnStartDate)) lcTime=formattime(tnStartTime) thisform.statedatetime=CTOT(lcDate+[ ]+lcTime) lnNextMeetID=gnnext("MEETINGS") gnMeetID=lnNextMeetID =REQUERY("MeetingProcedures") SELECT schcase =REQUERY("schcase") APPEND blank replace meetingnumber_a with lnNextMeetID replace meetingnumber_b with lnNextMeetID replace dept WITH gcViewDept replace roomname WITH tcRoomName replace schcase.begintime WITH rnd_dt15(thisform.statedatetime,900) replace schcase.endtime WITH begintime+1800 eLSE thisform.backcolor=RGB(255,255,224) gnMeetID=tiMeetID SELECT schcase =REQUERY('schcase') =REQUERY('meetingprocedures') endifThe problem I have is when tlEdit=.t., I requery("schcase") this returns 0 records since it is a new case. Then I do the Append Blank and the replaces. After that if I do a browse on the view (schcase) it shows my one record. If I then do a browse on the table primary table the view uses (Meetings), it shows a blank record and the one I've done the replaces on. If I don't do the Append Blank, the form controls are disabled (the control source for the form fields are schdata.fieldname) since there is no record. But once I hit the save button, my tableupdates save both records in the meeting table:
=TABLEUPDATE(.t.,.t.,'schcase') <== My View used to edit/add =TABLEUPDATE(.t.,.t.,'meetings') <== Primary Table used in View =TABLEUPDATE(.t.,.t.,'schedemo') <== Secondary table linked in viewThis is a new approach to me since I normally just created variables to store the data with a scatter. But with buffering and stuff, this seemed like a good approach. Every works great, except that I get two records in meetings. Any help appreciated. VFP6/7