B
balu
dear friends,
privatesub myform_befreupdate(cancel as integer)
'ow to update multiple records to same table ay one event
'im usingcode
dim dbs as dao.database
dim myrs as dao.recordset
set dbs=dbs.openrecordset("table")
if not isnull(me.option textbox) and me.optiontextbox = " 2 recordsupdate"
then
'update first record set
myrs.addnew
myrs!x=me.field1
myes!y = me.field2
myrs.update
msgbox "first set updated
'update second set
myrs.addnew
myrs!x = me.text20
myrs!y=me.text21
myrs.update
msgbox " second set updated"
else
'update first record set
myrs.addnew
myrs!x=me.field1
myes!y = me.field2
myrs.update
msgbox "first set updated
end if
docmd.gotorecord acdataform,"myform",acnewrec
end sub
(1) my problom is form not seting to new record
(2) before update event not completing
can any one help me please to update multiple records at one event or on
click event
balu
privatesub myform_befreupdate(cancel as integer)
'ow to update multiple records to same table ay one event
'im usingcode
dim dbs as dao.database
dim myrs as dao.recordset
set dbs=dbs.openrecordset("table")
if not isnull(me.option textbox) and me.optiontextbox = " 2 recordsupdate"
then
'update first record set
myrs.addnew
myrs!x=me.field1
myes!y = me.field2
myrs.update
msgbox "first set updated
'update second set
myrs.addnew
myrs!x = me.text20
myrs!y=me.text21
myrs.update
msgbox " second set updated"
else
'update first record set
myrs.addnew
myrs!x=me.field1
myes!y = me.field2
myrs.update
msgbox "first set updated
end if
docmd.gotorecord acdataform,"myform",acnewrec
end sub
(1) my problom is form not seting to new record
(2) before update event not completing
can any one help me please to update multiple records at one event or on
click event
balu