Private Sub cmdOK_Click()
Dim Cost_Sq As Double
Dim Tota_Cost As Double
Dim Commi As Double
Dim Ded As Double
Dim Add As Double
Dim total As Double
If txtP_Name.Text = "" Then
MsgBox "Please enter the Project Name.", vbExclamation, title
txtP_Name.SetFocus
GoTo EXITPROCEDURE
End If
If blAddProject = True Then
recProject.AddNew
recProject!ID = txtID.Text & ""
recProject!E_date = txtE_date.Text & ""
recProject!P_Name = txtP_Name.Text & ""
recProject!P_Nu = txtProjectNumber.Text & ""
recProject!P_Blk = txtProjectBlock.Text & ""
recProject!La_Num = txtLandNumber.Text & ""
recProject!Ty_Land = txtTypeLand.Text & ""
recProject!Tr_Date = txtTr_Date.Text & ""
recProject!Tr_Status = txtTr_Status.Text & ""
recProject!Tr_Resp = txtTr_Resp.Text & ""
recProject!Contr_Num = txtContr_num.Text & ""
recProject!Sq_flat = txtSq_Flat.Text & ""
recProject!Cost_Sq = txtCost_sq.Text & ""
Tota_Cost = txtSq_Flat * txtCost_sq
' con.Execute "Update Tot_Cost = " & txtSq_Flat.Text * txtCost_sq.Text & " where ID = '"
' recProject!Tot_Cost = txttot_cost.Text & ""
recProject!Commi = txtCommi.Text & ""
recProject!Ded = txtDed.Text & ""
recProject!Add = txtAdd.Text & ""
recProject!total = txtTotal.Text & ""
recProject.Update
MsgBox "Transaction done successfully.", vbExclamation, title
End If
If blUpdateProject = True Then
recProject.MoveFirst
Do While Not recProject.EOF
If recProject!ID = txtID.Text & "" Then
recProject!E_date = txtE_date.Text & ""
recProject!P_Name = txtP_Name.Text & ""
recProject!P_Nu = txtProjectNumber.Text & ""
recProject!PBlk = txtProjectBlock.Text & ""
recProject!La_Num = txtLandNumber.Text & ""
recProject!Ty_Land = txtTypeLand.Text & ""
recProject!Tr_Date = txtTr_Date.Text & ""
recProject!Tr_Status = txtTr_Status.Text & ""
recProject!Tr_Resp = txtTr_Resp.Text & ""
recProject!Contr_Num = txtContr_num.Text & ""
recProject!Sq_flat = txtSq_Flat.Text & ""
recProject!Cost_Sq = txtCost_sq.Text & ""
recProject!Tot_Cost = txttot_cost.Text & ""
recProject!Commi = txtCommi.Text & ""
recProject!Ded = txtDed.Text & ""
recProject!Add = txtAdd.Text & ""
recProject!total = txtTotal.Text & ""
recProject.UpdateBatch adAffectCurrent
End If
recProject.MoveNext
Loop
Unload Me
End If
EXITPROCEDURE:
Exit Sub
End Sub
****************
Please I need to calculate Tot_Cost = Sq_flat * Cost_sq and Total=Tot_cost-Ded+Add-commi
Any body correct this , so thank ful, basicaly i work in Oracle database...VB is new for me.
- 3 views