Default Values

L

Lloyd

I have created a simple form (based on an equally simple
query) with the primary keys of three tables to create a
new record in one of the tables. A Save command button
saves the record and opens a more detailed data entry
sheet.

Two of the tables have address information. Because the
address is often (but not always) the same, I would like
the values in the address fields in tblGrantee to be
placed in tblGrantSum when a new record is created.
Following is the base code that I am using. Do I need to
show the parent and or child address fields in the query?

Thanks, Lloyd

Private Sub cmdSaveRec_Click()
On Error GoTo Err_cmdSaveRec_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmGrantSumDE"

DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70

stLinkCriteria = "[DLCDGrant#]=" & "'" & Me!
[DLCDGrant#] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
 

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