GooGoocluster
Technical User
I am full of questions today...
I have a subform that is linked by the master Fieldname "project" what I want to do is use an entry form to creat new records with the "project" also linked here is the code I have. It works if the "Project" is already created. But I need it to display the ID even if its not created.
Code:
Private Sub AddJob2_Click()
On Error GoTo Err_AddJob2_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "InserterJobs entry"
stLinkCriteria = "[Project]=" & "'" & Me![Project] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_AddJob2_Click:
Exit Sub
Err_AddJob2_Click:
MsgBox Err.Description
Resume Exit_AddJob2_Click
End Sub
I have a subform that is linked by the master Fieldname "project" what I want to do is use an entry form to creat new records with the "project" also linked here is the code I have. It works if the "Project" is already created. But I need it to display the ID even if its not created.
Code:
Private Sub AddJob2_Click()
On Error GoTo Err_AddJob2_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "InserterJobs entry"
stLinkCriteria = "[Project]=" & "'" & Me![Project] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_AddJob2_Click:
Exit Sub
Err_AddJob2_Click:
MsgBox Err.Description
Resume Exit_AddJob2_Click
End Sub