With rstp
If NewRecord = True Then .AddNew
!slno_ID = txtslno.Text
!DepartureDate = txtdate.Value
!Departuretime = txttime.Text
!PlaceofVisit = cmbpov.Text
!ApproximateDistance = txtdistance.Text
!NoofDaysofStay = Txtstay.Text
!BusinessExpected = txtbusiness.Text
!Remarks = txtremarks.Text
.Update
.Requery
End With
arrtime = (CCur(txttime.Text) + CCur(txtdot.Text))
fm = (CCur(txtdistance.Text) * CCur(txtmr.Text))
arrtime1 = arrtime + (CCur(txtdot.Text))
With rste
If NewRecord = True Then .AddNew
!DepartureDate = txtdate.Value
!Departuretime = txttime.Text
!ArrivalPlace = cmbpov.Text
!ArrivalDate = txtdate.Value
!ArrivalTime = arrtime
!DeparturePlace = txtplace.Text
!daysstayedateachplace = Txtstay.Text
!ModeofTravel = txtmod.Text
!FareorMileage = fm
!TotalAmount = fm
.Update
.Requery
End With
DT = arrtime + 8
With rste
If NewRecord = True Then .AddNew
!DepartureDate = txtdate.Value
!Departuretime = DT
!ArrivalPlace = txtplace.Text
!ArrivalDate = txtdate.Value
!ArrivalTime = arrtime1
!DeparturePlace = cmbpov.Text
!daysstayedateachplace = Txtstay.Text
!ModeofTravel = txtmod.Text
!FareorMileage = fm
!TotalAmount = fm
.Update
.Requery
End With
With rstr
If NewRecord = True Then .AddNew
!slno_ID = txtslno.Text
!Place = cmbpov.Text
!Date = txtdate.Value
.Update
.Requery
End With
It works fine when i enter a new record but when i edit a existing record from a datagrid by displaying it in these texboxes the rstp manipulates the data how to solve this problem will somebody tell me.. rep me if u dint understand this problem.