i am making a program
in that i am doing calculations
after doing calculation i want to store calculated value in another table
but i dont know how to insert calculated data in table
program gives error in this part of code
following is my code
please help me.....
in that i am doing calculations
after doing calculation i want to store calculated value in another table
but i dont know how to insert calculated data in table
program gives error in this part of code
Code:
......................................
rs.Edit
rs.Fields("vol") = ("strComp")
rs.Update
............................
following is my code
Code:
Private Sub Command0_Click()
Dim dbsCurrent As Database
Dim rsCount As Recordset
Dim result As String
Dim result2 As String
Dim val As Double
Set dbsCurrent = CurrentDb
Set rsCount = _
dbsCurrent.OpenRecordset _
("SELECT Field1 FROM Query1 WHERE (id)= 3")
result = rsCount![Field1]
MsgBox (result)
Set rsCount = _
dbsCurrent.OpenRecordset _
("SELECT Field3 FROM Query1 WHERE (Field1)= 'Protokollersteller'")
result2 = rsCount![Field3]
MsgBox (result2)
Set rsCount = _
dbsCurrent.OpenRecordset _
("SELECT Field3 FROM Query1 WHERE (Field1)= 'Bezugsfrequenz'")
val = rsCount![Field3]
MsgBox (val)
Set rsCount = _
dbsCurrent.OpenRecordset _
("SELECT Field3 FROM jarman WHERE (Field1)= 'Bezugsfrequenz'")
val = rsCount![Field3]
val = val + 50
MsgBox (val)
rsCount.Close
Dim rs As Recordset, db As Database, strComp As String
Set db = CurrentDb
Set rs = db.OpenRecordset("data", dbOpenDynaset)
strComp = val
'You would now need to find the record that
'you wanted to add a comp value to.
'You could use the FindFirst method of the recordset to do this.
rs.Edit
rs.Fields("vol") = ("strComp")
rs.Update
DoCmd.OpenForm "type"
End Sub
Comment