C
chasday
In my project I have a On Click action that opens another form. The code is:
Private Sub JobName_Click()
On Error GoTo HandleError
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmProposal"
stLinkCriteria = "[Proposal ID]=" & Me![Proposal ID]
DoCmd.Close 'Close this form
DoCmd.OpenForm stDocName, , , stLinkCriteria
ExitHere:
Exit Sub
HandleError:
MsgBox Err.Description
Resume ExitHere
End Sub
Pretty straight forward and it works great. I think something is corupting
the application though, because out of nowhere it will stop working and
return a "Invaild use of Null" error. I have used a msgbox to verify that the
proper criteria string is passed out of the procedure, but when the
frmProposal is opened the [Proposal ID] criteria is Null. The only way I've
found to fix it is to revert to a backup (backup early and often). I'm not
doing anything major when it breaks. Often I'm not even working on the same
form.
Ideas?
Private Sub JobName_Click()
On Error GoTo HandleError
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmProposal"
stLinkCriteria = "[Proposal ID]=" & Me![Proposal ID]
DoCmd.Close 'Close this form
DoCmd.OpenForm stDocName, , , stLinkCriteria
ExitHere:
Exit Sub
HandleError:
MsgBox Err.Description
Resume ExitHere
End Sub
Pretty straight forward and it works great. I think something is corupting
the application though, because out of nowhere it will stop working and
return a "Invaild use of Null" error. I have used a msgbox to verify that the
proper criteria string is passed out of the procedure, but when the
frmProposal is opened the [Proposal ID] criteria is Null. The only way I've
found to fix it is to revert to a backup (backup early and often). I'm not
doing anything major when it breaks. Often I'm not even working on the same
form.
Ideas?