I have a main form from which I want to open another form and add a new record with the compnay of the new record equal to the company of the original form. Being VB challenged I am not getting this to work. Following is code I currently have. ANy help would be appreciated.
** Also can anyone recommend a good starter VB book for access.
Thanks,
Mary Ann
Private Sub Create_Fax_Click()
On Error GoTo Err_Create_Fax_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Fax"
stLinkCriteria = "Forms![Fax]![FaxCompany]=" & Me![ID]
DoCmd.OpenForm stDocName, , , , acFormAdd, stLinkCriteria
Exit_Create_Fax_Click:
Exit Sub
Err_Create_Fax_Click:
MsgBox Err.Description
Resume Exit_Create_Fax_Click
End Sub
** Also can anyone recommend a good starter VB book for access.
Thanks,
Mary Ann
Private Sub Create_Fax_Click()
On Error GoTo Err_Create_Fax_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Fax"
stLinkCriteria = "Forms![Fax]![FaxCompany]=" & Me![ID]
DoCmd.OpenForm stDocName, , , , acFormAdd, stLinkCriteria
Exit_Create_Fax_Click:
Exit Sub
Err_Create_Fax_Click:
MsgBox Err.Description
Resume Exit_Create_Fax_Click
End Sub