Fireman1143
IS-IT--Management
Good day!
I have an application in which I use a button to send the user form the list of Contracts to the one they selected with the button. The DetailButton code is below. This same coding works in all sections EXCEPT for the Contracts ( I also have Licenses, Software, Systems, Peripherals etc all work)
When the button is clicked, an Access input box pops up and has the ContractNumber where we would put the question. If I put that same number in the input area of the box, it takes me to the correct Contract) I can not figure why the box is appearing and have tried re-writing the stLinkCriteria various ways. The form names and field names are correct.
Any thoughts or does someone see my error?
Private Sub DetailButton_Click()
On Error GoTo Err_DetailButton_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmContracts" :The form I am opening
stLinkCriteria = "[ContractNumber] =" & Me![ContractNumber] :The Contract Number is used for selection and has the same name on both forms
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_DetailButton_Click:
Exit Sub
Err_DetailButton_Click:
MsgBox Err.Description
Resume Exit_DetailButton_Click
End Sub
Thanks,
Fireman1143
I have an application in which I use a button to send the user form the list of Contracts to the one they selected with the button. The DetailButton code is below. This same coding works in all sections EXCEPT for the Contracts ( I also have Licenses, Software, Systems, Peripherals etc all work)
When the button is clicked, an Access input box pops up and has the ContractNumber where we would put the question. If I put that same number in the input area of the box, it takes me to the correct Contract) I can not figure why the box is appearing and have tried re-writing the stLinkCriteria various ways. The form names and field names are correct.
Any thoughts or does someone see my error?
Private Sub DetailButton_Click()
On Error GoTo Err_DetailButton_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmContracts" :The form I am opening
stLinkCriteria = "[ContractNumber] =" & Me![ContractNumber] :The Contract Number is used for selection and has the same name on both forms
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_DetailButton_Click:
Exit Sub
Err_DetailButton_Click:
MsgBox Err.Description
Resume Exit_DetailButton_Click
End Sub
Thanks,
Fireman1143