W
Wayne
Here's the code I have so far:
Private Sub OpenPrintReq_Click()
On Error GoTo Err_OpenPrintReq_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "PrintRequisition"
If IsNull([JobNumber]) Then
MsgBox "You must select a Job #."
DoCmd.GoToControl "JobNumber"
Else
stLinkCriteria = "[ProjectID]=" & "'" &
Me![JobNumber] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria,
acFormPropertySettings
Me.Visible = False
End If
Exit_OpenPrintReq_Click:
Exit Sub
Err_OpenPrintReq_Click:
MsgBox Err.Description
Resume Exit_OpenPrintReq_Click
End Sub
When i select a ProjectID from the JobNumber combo and
click the open button it opens the PrintRequistion form
containing the record with the selected ProjectID.
Here's where I need some help....
If there is no record in the PrintRegister table containing
the selected ProjectID, I want it to automatically create a
new record with that ProjectID.
I hope someone can help me with this.
Thanks
Private Sub OpenPrintReq_Click()
On Error GoTo Err_OpenPrintReq_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "PrintRequisition"
If IsNull([JobNumber]) Then
MsgBox "You must select a Job #."
DoCmd.GoToControl "JobNumber"
Else
stLinkCriteria = "[ProjectID]=" & "'" &
Me![JobNumber] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria,
acFormPropertySettings
Me.Visible = False
End If
Exit_OpenPrintReq_Click:
Exit Sub
Err_OpenPrintReq_Click:
MsgBox Err.Description
Resume Exit_OpenPrintReq_Click
End Sub
When i select a ProjectID from the JobNumber combo and
click the open button it opens the PrintRequistion form
containing the record with the selected ProjectID.
Here's where I need some help....
If there is no record in the PrintRegister table containing
the selected ProjectID, I want it to automatically create a
new record with that ProjectID.
I hope someone can help me with this.
Thanks