Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating fields in the table

Status
Not open for further replies.

svm

Programmer
Apr 26, 2001
44
US
I got this problem when I'm trying to do some calculations in the table or file, it doesn't update. what's wrong with my syntax ?

Program Code :

Private Sub cmdBidUpd_Click()
On Error GoTo UpdErr

With BidRecordset
!F_Number = txtbidflds(0).Text
!BidDate = txtbidflds(1).Text
!Bid_Year = cbobid(1).Text
!Base_Alt = cbobid(0).Text
![Rebid#] = cbobid(2).Text
!Plant = cbobid(3).Text
!SquareFeet = Val(txtbidflds(2).Text)
!TotalCost = Val(txtbidflds(3).Text)
!Cost_SquareFeet = Val(txtbidflds(4).Text)
!Contribution = Val(txtbidflds(5))
!Contribution_SqFeet = Val(txtbidflds(6).Text)
!SalesPrice = Val(txtbidflds(7).Text)
!SalesPrice_SqFeet = Val(txtbidflds(8).Text)
![Actual_Bid_Amount] = Val(txtbidflds(9).Text)
!SelectedBid = Format(txtbidflds(10), "")
!ContributionPcnt = Val(txtbidflds(11))
Dim Var1
Var1 = 1 - txtbidflds(11) / 100

![TempPcnt] = Val(Var1)
!DateApproved = Format(txtbidflds(12).Text, "mm/dd/yyyy")
If txtbidflds(13).Text = "" Then
txtbidflds(13).Text = " "
Else
!Adjustment_Notes = txtbidflds(13).Text
End If
!Estimator = cbobid(4).Text
If cbobid(5).Text = "" Then
cbobid(5).Text = " "
Else
!Complexity = cbobid(5).Text
End If
!Time = Val(txtbidflds(14).Text)
If cbobid(6).Text = "" Then
cbobid(6).Text = " "
Else
!Accuracy = cbobid(6).Text
End If
!CheckedBy = cbobid(7).Text
!TimeChecking = Val(txtbidflds(15).Text)
.Update
End With
SSTab1.TabEnabled(1) = True
SSTab1.Tab = 1
CmdBidAdd.Enabled = True
CmdBidDel.Enabled = False
MsgBox "Updated Record"
Exit Sub
UpdErr:
MsgBox "Record Not Updated"
End Sub

The field that is not updating is the TempPcnt. How do you replace a value of a field from another field called var1.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top