Auto populate subform in new row

G

grant2684

Hi,

I have a main form with a "status" field. On the after update procedure, i
would like an auto populated note adding to the next record in a tabular form
(subform) - see below.

I have started the code, but this only populates the first record in the
subform. I have tried adding the FindNext command but it doesn't seem to work?


I have started the code as follows:

Private Sub Status_Change()
If [Status] = "New" Then [NotesForm]![Notes] = "New case added"
If [Status] = "Completed" Then [NotesForm]![Notes] = "Case completed"
If [Status] = "Pending" Then [NotesForm]![Notes] = "Case pending"

End Sub

Any help would be much appreciated.

Kind regards,

Grant
 
P

PieterLinden via AccessMonster.com

grant2684 said:
Hi,

I have a main form with a "status" field. On the after update procedure, i
would like an auto populated note adding to the next record in a tabular form
(subform) - see below.

I have started the code, but this only populates the first record in the
subform. I have tried adding the FindNext command but it doesn't seem to work?

I have started the code as follows:

Private Sub Status_Change()
If [Status] = "New" Then [NotesForm]![Notes] = "New case added"
If [Status] = "Completed" Then [NotesForm]![Notes] = "Case completed"
If [Status] = "Pending" Then [NotesForm]![Notes] = "Case pending"

End Sub

Any help would be much appreciated.

Kind regards,

Grant

Don't you have to insert/go to a new record in the subform before you can
update it?
 
G

grant2684 via AccessMonster.com

Hi,

The form is a one to many relationship and the subform is a tabular form (so
a new record is already there to insert in to).

If it helps, the primary key for the subform is NotesID?

Any help would be much appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top