Sorry to take so long to get back to you. I don't work on Fridays, so I just
got this when I came in this morning.
Thanks for all the useful info. The one thing I think I forgot to ask, if
is there is any way to tie these two records together. That is, if one of
them is your current record, is there a way to know that it has a partner
record and to be able to navigate to it.
In any case, to add the record, I would suggest you put the code you need in
the After Update event of your form. In the Form Open event, create a
recordset for DailyCash and in the Form After Update event, create a new
record. Be sure to declare your record set variables at the module level.
At the module level:
Dim rstDailyCash as Recordset
Dim dbf as Database
In the Form Open event:
Set dbf = CurrentDb
Set rstDailyCash = dbf.OpenRecordset("DailyCash", dbOpenDynaset)
In the Form After Upddate event:
With rstDaiyCash
.AddNew
![Company] = Me.txtDispursTo
![CashAmount = Me.txtCashAmount * -1
.....etc 'I think you see what I mean here, just add your fields
and controls
.Update
End With
The modify and delete will take a little more. You probably have a Delete
command button, so you would have to find the related record and do a delete.
As to the modify, that should also probably go in the Form After Update, but
then you will have to know if you are adding a new record or modifying an
existing record and add the logic to the code above.
I hope this gives you a start, post back if you have more questions.