Help with Adding a new record to a subform

J

Joe Cilinceon

First off I have Access 2000 with DAO methods set.


Here is the senerio, I'm on the main Tenant form at the Payment screen. I
post the payment (shown on a sub form). Now say the tenant is short on what
he owes, while I still have the transaction I just posted selected, I click
a button on the main form to print a balance due letter. So far this works
fine, as long as I have the right transaction selected.

Here is where I need some help. Each tenant has a seperate table with notes.
This table has the custno, date of the note and the note itself. This is
also loaded as a subform on another tab screen. I would like to add a new
Note thas says when I hit the Print Letter button. How would I do this as
I'm not sure what code is necessary to add a new record. I would like the
Note to have the current date with the note saying 'Printed: Balance Due
Letter' and of corse it will
need the customer number which is what the main form is pointed at.

I hope that is clear.
 
M

MacDermott

You can use an append query to accomplish this.
The SQL will look something like this:
"INSERT INTO tblNotes (ClientID, NoteDate, NoteText) VALUES " & _
"(" & Forms!MainForm!ClientID & ",#" & Date() & "#,'Printed: Balance
Due Letter')"

You may want to requery your Notes subform, too, to display this entry.

HTH
 

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