S
smk23
In the following code, I am trying to pass a control to a sub so that I can
change the default value on that control if needed. Do I need to set the
control in the calling code? I don't get a compile error or runtime error
with the following, but the default is not reset:
Private Sub ReportTemplateIDOR_AfterUpdate()
sReportDefault Me.ReportTemplateIDOR, _
Me.ReportTemplateIDOR.value
End Sub
Private Sub sReportDefault( _
ctReport As Control, _
lngReportTemplateID As Long)
On Error GoTo Error_Handler
Dim strTitle As String
Dim strInput As String
Dim blnResponse As Boolean
strTitle = "Default Report"
strInput = "Do you want to make this the permanent report default? "
blnResponse = MsgBox(strInput, vbYesNo, strTitle)
If blnResponse = True Then
ctReport.DefaultValue = lngReportTemplateID
End If
change the default value on that control if needed. Do I need to set the
control in the calling code? I don't get a compile error or runtime error
with the following, but the default is not reset:
Private Sub ReportTemplateIDOR_AfterUpdate()
sReportDefault Me.ReportTemplateIDOR, _
Me.ReportTemplateIDOR.value
End Sub
Private Sub sReportDefault( _
ctReport As Control, _
lngReportTemplateID As Long)
On Error GoTo Error_Handler
Dim strTitle As String
Dim strInput As String
Dim blnResponse As Boolean
strTitle = "Default Report"
strInput = "Do you want to make this the permanent report default? "
blnResponse = MsgBox(strInput, vbYesNo, strTitle)
If blnResponse = True Then
ctReport.DefaultValue = lngReportTemplateID
End If