angelfish0517
01-13-2004, 02:12 AM
Hi there! I'm having hard time solving this runtime error ("You entered an expression that has no value") Does anyone knows the solution? Any help would be greatly appreciated. Thanks!
Option Compare Database
'don't allow undeclared variables
Option Explicit
Public OldRes As String
Private Sub cboResDvr_AfterUpdate()
'activate the form
DoCmd.SelectObject acForm, "Resource Analysis"
'set ResDriver to value of bounded field in the referenced table
ResDriver = cboResDvr
'filter the query by the chosen BRUCode in BRUCont variable
'and ResDriver from the value of the control cboResDvr
DoCmd.ApplyFilter "Value Allocation Query" + ptl, "[BRUCode]='" + BRUCont + "' And " + "DrvCode='" + ResDriver + "'"
'refresh values of the form particularly the txtTotalSplit text box control
Me.Recalc
'check if splits are already present and flag user
Me.txtTotalSplit.SetFocus
If Not IsNull(Me.txtTotalSplit.Value) And Me.txtTotalSplit.Value <> 0 Then
MsgBox "You already have value for this resource.", vbOKOnly + vbInformation + vbApplicationModal, "Flag"
End If
'get focus away from txtTotalSplit to avoid edit by user
Me.cboResDvr.SetFocus
End Sub
Option Compare Database
'don't allow undeclared variables
Option Explicit
Public OldRes As String
Private Sub cboResDvr_AfterUpdate()
'activate the form
DoCmd.SelectObject acForm, "Resource Analysis"
'set ResDriver to value of bounded field in the referenced table
ResDriver = cboResDvr
'filter the query by the chosen BRUCode in BRUCont variable
'and ResDriver from the value of the control cboResDvr
DoCmd.ApplyFilter "Value Allocation Query" + ptl, "[BRUCode]='" + BRUCont + "' And " + "DrvCode='" + ResDriver + "'"
'refresh values of the form particularly the txtTotalSplit text box control
Me.Recalc
'check if splits are already present and flag user
Me.txtTotalSplit.SetFocus
If Not IsNull(Me.txtTotalSplit.Value) And Me.txtTotalSplit.Value <> 0 Then
MsgBox "You already have value for this resource.", vbOKOnly + vbInformation + vbApplicationModal, "Flag"
End If
'get focus away from txtTotalSplit to avoid edit by user
Me.cboResDvr.SetFocus
End Sub