bassman197
Registered User.
- Local time
- Yesterday, 20:25
- Joined
- Sep 18, 2007
- Messages
- 35
Hi,
I have inherited a database that writes contracts and invoices and I now need to add something to it that's beyond my pay grade! Right now a command button on the contract form (Me!) opens vendor contracts (called "multi-confirmations") that match the contract number (EventID). It was created with the wizard using the "open the form and find data to display there" option:
Private Sub Command782_Click()
On Error GoTo Err_Command782_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Multi-Confirmation"
stLinkCriteria = "[EventID]=" & Me![EventID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command782_Click:
Exit Sub
Err_Command782_Click:
MsgBox Err.Description
Resume Exit_Command782_Click
Basically, I want this button to now say: "open the matching forms, but if you don't find any, then create a new record in form "Multi-Confirmation" and then set it's [EventID] to match the [EventID] of the parent form.
Once that first form is opened, I'll add a button to it to allow the user to create additional vendor contracts ("multi-confirmations") with the same number, since ONE contract (for a client) may have MANY vendor contracts.
Any help would be appreciated - I'm trying to get this up and running so contracts can be created within a few days! (what have I gotten myself into!)
I have inherited a database that writes contracts and invoices and I now need to add something to it that's beyond my pay grade! Right now a command button on the contract form (Me!) opens vendor contracts (called "multi-confirmations") that match the contract number (EventID). It was created with the wizard using the "open the form and find data to display there" option:
Private Sub Command782_Click()
On Error GoTo Err_Command782_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Multi-Confirmation"
stLinkCriteria = "[EventID]=" & Me![EventID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command782_Click:
Exit Sub
Err_Command782_Click:
MsgBox Err.Description
Resume Exit_Command782_Click
Basically, I want this button to now say: "open the matching forms, but if you don't find any, then create a new record in form "Multi-Confirmation" and then set it's [EventID] to match the [EventID] of the parent form.
Once that first form is opened, I'll add a button to it to allow the user to create additional vendor contracts ("multi-confirmations") with the same number, since ONE contract (for a client) may have MANY vendor contracts.
Any help would be appreciated - I'm trying to get this up and running so contracts can be created within a few days! (what have I gotten myself into!)