Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update/ Insert 1

Status
Not open for further replies.

lashwarj

IS-IT--Management
Nov 1, 2000
1,067
US
Section one runs great, but when i run section 2 in the code it does not set the where correctly. I dump the values from the memVar, requery the table, then run a compair to then insert values where they are in one table but not the next. My code looks like it should work correct.




Section 1)

WITH ThisForm.Agenda_List
FOR indx = 1 to .ListCount
SELECT agenda_order_info
M.MEETING_DATE = meetingdate
M.PM_ID = VAL(.ListItem(.IndextoItemID(indx), 1))
M.AGENDA_ORDER = indx
INSERT INTO agenda_order_info FROM MEMVAR
NEXT
ENDWITH

Section 2)
REQUERY('agenda_order_info')
INSERT INTO agenda_order_info (pm_id, meeting_date) ;
SELECT pm_id, meeting_date FROM agenda_order_view;
WHERE agenda_order_view.meeting_date = meetingdate AND agenda_order_info.pm_id <> agenda_order_view.pm_id
 
Hi


INSERT INTO agenda_order_info (pm_id, meeting_date) ;
SELECT pm_id, meeting_date FROM agenda_order_view;
WHERE agenda_order_view.meeting_date = meetingdate AND agenda_order_info.pm_id <> agenda_order_view.pm_id

is not correct..

SELECT pm_id, meeting_date FROM agenda_order_view;
WHERE agenda_order_view.meeting_date = meetingdate ;
AND agenda_order_info.pm_id <> agenda_order_view.pm_id ;
INTO ARRAY laArray

INSERT INTO agenda_order_info FROM ARRAY laArray

This will work.. provided agenda_order_info has only these twi fields since inderting from ARRAY goes in the field order and no specific field names can be provided.


:)

ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
What if there are fields in that table that are in between. my agenda_order_info table has 4 fields (order_id, meeting_date, agenda_order, pm_id)


The agenda_order_view has a a ton...........
 
If you have a view with only these two fields, you can make use of that method. Otherwise, better insert one by one by using a loop.

:)

ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Still not working

Heres the code I got so far but it still does the same thing. If you insert one and only one record into the list box it works great, but if you insert more then one record it will dump more then one record into the secord process table. I * out process 2 and it runs great, my values from the list box are dumped. Then is I undo the * it dumps the desired values, and when it comes time to dump the values where the one table doesnt match the second table it dumps all the ones that dont match and a few that do match.


PROCESS 1

WITH ThisForm.Agenda_List
FOR indx = 1 to .ListCount
SELECT agenda_order_info
M.MEETING_DATE = meetingdate
M.PM_ID = VAL(.ListItem(.IndextoItemID(indx), 1))
M.AGENDA_ORDER = indx
INSERT INTO agenda_order_info FROM MEMVAR
NEXT
ENDWITH


PROCESS 2

SELECT pm_id, meeting_date FROM agenda_order_view;
WHERE agenda_order_view.meeting_date = meetingdate ;
AND agenda_order_info.pm_id <> agenda_order_view.pm_id ;
INTO ARRAY laArray
INSERT INTO agenda_order_info FROM ARRAY laArray
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top