DavidDF1913
asked on
Add a table record table linked to a sub form to correct table
I have 2 basic tables: clientTbl and MatterTbl. They are joined by the client no. and matter no. fields in both in the tables. The matterTbl contains jobs related to particular clients. A client might have two matters or a hundred.
ClientTbl fields: cCno, cMno (both numeric), client (char). MatterTbl: mCno, mMno, matterName (char).
My primary form has the client table and the sub form contains the matter table.
I want to have command buttons that will say: add Client, add Matter, delete Client, delete matter. Adding a new client will just create a blank client record but adding a matterTbl record must insert the client no (cCno) displayed in the primary form and the matter no (mMno) can be blank (usually last matter number for the client plus one). I also want to specify which tables the records are added to. Here is my add client code:
Private Sub ComSaveClient_Click()
' add matter from client form
On Error GoTo Err_ComSaveClient_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_ComSaveClient_click:
Exit Sub
Err_Command34_Click:
MsgBox Err.Description
Resume Exit_ComSaveClient_click
End Sub
Thank you for any help you can offer.
David
ClientTbl fields: cCno, cMno (both numeric), client (char). MatterTbl: mCno, mMno, matterName (char).
My primary form has the client table and the sub form contains the matter table.
I want to have command buttons that will say: add Client, add Matter, delete Client, delete matter. Adding a new client will just create a blank client record but adding a matterTbl record must insert the client no (cCno) displayed in the primary form and the matter no (mMno) can be blank (usually last matter number for the client plus one). I also want to specify which tables the records are added to. Here is my add client code:
Private Sub ComSaveClient_Click()
' add matter from client form
On Error GoTo Err_ComSaveClient_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_ComSaveClient_click:
Exit Sub
Err_Command34_Click:
MsgBox Err.Description
Resume Exit_ComSaveClient_click
End Sub
Thank you for any help you can offer.
David
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am going to use the auto-number fields for client and matters tables, however, since most additions will be in order even while the database is being updated.
David