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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple insert using loop

Status
Not open for further replies.

Richey

Technical User
Aug 29, 2000
121
GB
I have 5 tick-boxes on a form, 2002/03, 2003/04, 2004/05, 2005/06 and 2006/07.
The user can select one or more of these tick-boxes - they then click 'generate funding matrix'
there is a table called tblSECT_funding
If the user, for example, selects 2002/03 and 2005/06 I'd like the table to be populated with 2 rows. One field in the table, namely tag, must have the date included i.e record 1 has a tag of 2002/03 and record 2 has a tag of 2005/06.
The user can then enter data into the matrix for the 2 years only
How can I go about this please?

Regards
Richey

 
here is a rough example of one of many ways you could do it typed on the fly so will need serios debuggin but hope it gets you started


dim x as integer
dim arrdate()
'place value in array
if 2002/03 = -1 then arrdate(0) = 2002/03
if 2003/04 = -1 then arrdate(1) = 2003/04
if 2004/05 = -1 then arrdate(2) = 2004/05
if 2005/06 = -1 then arrdate(3) = 2005/06
if 2006/07 = -1 then arrdate(4) = 2006/07
for x = 0 to 4 loop theu each array
if not isnull(arrdate(x)) then ' if a value run append query
domcmd.runsql "insert into tblSECT_funding(tag) values(arraydate(x))"
end if
next x
end sub



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top