Darkprince
Sep 8th, 2000, 05:09 PM
I am trying to add a new field, from VB, to an exsiting Access Table.
When I try with a text box, which is linked to the Table, any changes I make to the text box is stored in the table, without any problems! So far so good.
But when i try to add a new field (without an object), just using the code, like:
DatAutoSensor.Recordset.AddNew
DatAutoSensor.Recordset!SensorID = strSensorID
DatAutoSensor.Recordset!DateTime = strDate
DatAutoSensor.Recordset.Update
DatAutoSensor.Recordset.MoveFirst
...where "strSensorID" abd "strDate" are dynamically created variables (not from any VB Object) and "SensorID" and "DateTime" are fields in the Table...it doesn't work. The Table isn't updated!! why is this? How am I supposed to achieve this?
When I try with a text box, which is linked to the Table, any changes I make to the text box is stored in the table, without any problems! So far so good.
But when i try to add a new field (without an object), just using the code, like:
DatAutoSensor.Recordset.AddNew
DatAutoSensor.Recordset!SensorID = strSensorID
DatAutoSensor.Recordset!DateTime = strDate
DatAutoSensor.Recordset.Update
DatAutoSensor.Recordset.MoveFirst
...where "strSensorID" abd "strDate" are dynamically created variables (not from any VB Object) and "SensorID" and "DateTime" are fields in the Table...it doesn't work. The Table isn't updated!! why is this? How am I supposed to achieve this?