I have a database that utilizes multiple instances of the same form.
The current form instance is stored in a variable and if data entry occurs, the form instance is referenced as part of the vba command. So far this works without a hitch. I mention this first in case it comes to bear... which I don't think it will! OK here's the issue.
I have a datasheet from which I do data entry. The last column of the datasheet holds user comments and tends to be lengthy. Since space is limited, I wrote a pop-up window for this field which populates with the data from the field and allows data entry and editing. Anything done here is loaded to the last column field. The code from the data entry form is below:
frm_instance.frm_comm_internal1.Form.comm_comment.Value = txt_comments.Value
This is run from the data entry form where comm_comment is the field on the data entry form and txt_comment is the field on the data entry form.
Sometimes, but not always the command will throw an error. Sometimes but not always, it updates the wrong field. Usually, it works just fine.
I think the reason for this is that Access doesn't know which field to update, but since I cannot reproduce it reliably it is hard to say. SO the answer seems to be to add a reference to the record that access is supposed to be updating. The problem is, the record reference is an autonumber that doesn't populate until the record is completed.
Is there some way to programatically refer to a the open record or some other cleverness to refer to this record. Thanks.