Please tell me the necessary code to read a first table for information then search a second table. If no match, add a new record to the second table. Thanks!

Re: Form that maintains a table by reading a second table 80 80

try this

rs.open "select mycol from mytable where mycol='"+myvalue+"'",mycon
if rs.eof=false then
rs1.open "select * from mytable1 where mycol1='"+rs(0)+"'",mycon
if rs.eof<>false then
rs1.addnew
rs1(0)=myval1
rs1(1)=myval2
.
.
.
rs1.update
endif
rs1.close
rs.close
endif
Re: Form that maintains a table by reading a second table 80 80

keep rs.close after endif

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.