By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,300 Members | 1,867 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,300 IT Pros & Developers. It's quick & easy.

Updating a related table

P: n/a
Hi all,
Im using the after update event of a field from a bound form to add records
using the recordset object, to a related table. However i'm getting the 3201
error, telling me I must have a related record in the parent table. But i've
just put it in, since the 'afterupdate' wont fire until i have ? It works
fine when i'm changing the record in the parent table, since im not changing
the primary key, but happens when i'm adding a new record.

Any explaination, or advice most welcome

Gerry Abbott



Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Apologies for not testing this further,

It is not working with the update, and uses the 'non-updated' data to update
the related table, not the updated!
"Gerry Abbott" <pl****@ask.ie> wrote in message
news:1a*******************@news.indigo.ie...
Hi all,
Im using the after update event of a field from a bound form to add
records using the recordset object, to a related table. However i'm
getting the 3201 error, telling me I must have a related record in the
parent table. But i've just put it in, since the 'afterupdate' wont fire
until i have ? It works fine when i'm changing the record in the parent
table, since im not changing the primary key, but happens when i'm adding
a new record.

Any explaination, or advice most welcome

Gerry Abbott


Nov 13 '05 #2

P: n/a
It sounds like you need to save the parent record before adding the new
child ones. The value of the field may be getting updated, but this does not
save the record. If you precede your record-adding code with

DoCmd.RunCommand acCmdSaveRecord

that should help.

"Gerry Abbott" <pl****@ask.ie> wrote in message
news:1a*******************@news.indigo.ie...
Hi all,
Im using the after update event of a field from a bound form to add records using the recordset object, to a related table. However i'm getting the 3201 error, telling me I must have a related record in the parent table. But i've just put it in, since the 'afterupdate' wont fire until i have ? It works
fine when i'm changing the record in the parent table, since im not changing the primary key, but happens when i'm adding a new record.

Any explaination, or advice most welcome

Gerry Abbott


Nov 13 '05 #3

P: n/a
Hit the nail right on the head
Thanks Dave,
"Dave M" <NO************@DROPTHISisland.net> wrote in message
news:Y9nrd.400583$nl.94527@pd7tw3no...
It sounds like you need to save the parent record before adding the new
child ones. The value of the field may be getting updated, but this does
not
save the record. If you precede your record-adding code with

DoCmd.RunCommand acCmdSaveRecord

that should help.

"Gerry Abbott" <pl****@ask.ie> wrote in message
news:1a*******************@news.indigo.ie...
Hi all,
Im using the after update event of a field from a bound form to add

records
using the recordset object, to a related table. However i'm getting the

3201
error, telling me I must have a related record in the parent table. But

i've
just put it in, since the 'afterupdate' wont fire until i have ? It works
fine when i'm changing the record in the parent table, since im not

changing
the primary key, but happens when i'm adding a new record.

Any explaination, or advice most welcome

Gerry Abbott



Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.