CHAOSinACT
Registered User.
- Local time
- Today, 13:12
- Joined
- Mar 18, 2009
- Messages
- 235
i have a script here:
Public Sub LoadMaterialsUsed()
If Form_frmCivilMinorJobs.toggleQuoteOnly.Value = False Then
'total of materials cost
Dim curTotalMaterials As Currency
'recordset application variable
Dim rsCivilCostCurrentJobMaterials As ADODB.Recordset 'bill types
Set rsCivilCostCurrentJobMaterials = New ADODB.Recordset
rsCivilCostCurrentJobMaterials.ActiveConnection = CurrentProject.Connection
rsCivilCostCurrentJobMaterials.Source = "qryCivilCostCurrentJobMaterials"
rsCivilCostCurrentJobMaterials.CursorType = adOpenDynamic
rsCivilCostCurrentJobMaterials.LockType = adLockOptimistic
'open costing recordset
rsCivilCostCurrentJobMaterials.Open
rsCivilCostCurrentJobMaterials.MoveFirst
Do While rsCivilCostCurrentJobMaterials <> EOF
curTotalMaterials = curTotalMaterials + rsCivilCostCurrentJobMaterials!TotalSpent
rsCivilCostCurrentJobMaterials.MoveNext
Loop
If curTotalMaterials <> "" Then
Form_frmCivilMinorJobs.txtMaterials_used.Value = curTotalMaterials
If Form_frmCivilMinorJobs.chkExcelQuoteAvailable.Value = True Then
Form_frmCivilMinorJobs.txtMaterials_remaining.Value = Form_frmCivilMinorJobs.txtMaterials.Value - curTotalMaterials
Else
Form_frmCivilMinorJobs.txtMaterials_remaining.Value = Form_frmCivilMinorJobs.txtManualMaterials.Value - curTotalMaterials
End If
End If
rsCivilCostCurrentJobMaterials.Close
Set rsCivilCostCurrentJobMaterials = Nothing
End If
End Sub
now everytime it hits this and loads it stops at the top (public sub) and says "argument not optional" ...darned if i was aware of any argument being needed here esp in the top of it as it has nothing passed to it.... anyone see what i'm missing? thanks.
Public Sub LoadMaterialsUsed()
If Form_frmCivilMinorJobs.toggleQuoteOnly.Value = False Then
'total of materials cost
Dim curTotalMaterials As Currency
'recordset application variable
Dim rsCivilCostCurrentJobMaterials As ADODB.Recordset 'bill types
Set rsCivilCostCurrentJobMaterials = New ADODB.Recordset
rsCivilCostCurrentJobMaterials.ActiveConnection = CurrentProject.Connection
rsCivilCostCurrentJobMaterials.Source = "qryCivilCostCurrentJobMaterials"
rsCivilCostCurrentJobMaterials.CursorType = adOpenDynamic
rsCivilCostCurrentJobMaterials.LockType = adLockOptimistic
'open costing recordset
rsCivilCostCurrentJobMaterials.Open
rsCivilCostCurrentJobMaterials.MoveFirst
Do While rsCivilCostCurrentJobMaterials <> EOF
curTotalMaterials = curTotalMaterials + rsCivilCostCurrentJobMaterials!TotalSpent
rsCivilCostCurrentJobMaterials.MoveNext
Loop
If curTotalMaterials <> "" Then
Form_frmCivilMinorJobs.txtMaterials_used.Value = curTotalMaterials
If Form_frmCivilMinorJobs.chkExcelQuoteAvailable.Value = True Then
Form_frmCivilMinorJobs.txtMaterials_remaining.Value = Form_frmCivilMinorJobs.txtMaterials.Value - curTotalMaterials
Else
Form_frmCivilMinorJobs.txtMaterials_remaining.Value = Form_frmCivilMinorJobs.txtManualMaterials.Value - curTotalMaterials
End If
End If
rsCivilCostCurrentJobMaterials.Close
Set rsCivilCostCurrentJobMaterials = Nothing
End If
End Sub
now everytime it hits this and loads it stops at the top (public sub) and says "argument not optional" ...darned if i was aware of any argument being needed here esp in the top of it as it has nothing passed to it.... anyone see what i'm missing? thanks.