PDA

Click to See Complete Forum and Search --> : Let me rephrase my previous question...


krbrown
Aug 2nd, 1999, 01:38 AM
Hopefully, if I rephrase, I can get an answer! My problem is this: I have a database with three tables. I've created a VB form to update one of the tables (the Events table). The other two tables (Manuscripts and Markets) won't be updated with this VB form--they are only to pull in information.

The VB form pulls in the primary keys from the other two tables (manu_number and market_number) and puts them in text boxes. It does that o.k.. I want it to write those numbers to the appropriate fields in the Events table. This way, the Events table will be able to keep track of which event affected which manuscript.

If you've read this far, thanks! Here's the code I have:

Events.Recordset.Edit
Events!market_number = txt_market_num
Events!manuscript_number = txt_manu_num
Events.Recordset.Update

I put this code in a command button click event called "Update Database".

This was just a shot in the dark to try to get it to write to my Events table, but it doesn't work!

I have three data elements on the form, Events, Markets, and Manuscripts. Any ideas as to why the code above doesn't work? Events is my RecordSource, and it's a dynaset. The error I get is "Can't assign to read-only property."

I'd appreciate any help!

Kimberly

preeti
Aug 2nd, 1999, 05:33 PM
Hi,

At what line in the code do you get your error?

Also, instead of Events.Recordset.Edit
try Events.Recordset.Addnew

Edit is used for editing an existing record which is, I think, what you do not want.

HTH,

Preeti

krbrown
Aug 3rd, 1999, 06:31 AM
Thanks! Actually, I dug through some other posts and found some code that you suggested to someone else that I was able to modify to make work for me. So, you helped without even trying!

Thanks again.

Kimberly