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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Update Problem

Status
Not open for further replies.

hm1sal

MIS
May 30, 2002
6
US
I have a form bound to an access table via ADO. Several txt boxes that get their value based on what the user selects with several option boxes. If new record, all is well. If editing existing record, controls function normally, and txt boxes show new values. If the user only uses the option boxes to edit the values, and clicks save, the record is not updated in the database, and no errors are generated. However, if the user manually enters any txtbox and makes any change, all updates are saved correctly, including those changed with the option boxes. Make me think there is some change flag set somewhere that I do not know about that needs to be set in the click event of the option boxes.

Any help appreciated...thanks

-js

 
Hi js, Can you post the code you're using to update for us to take a look.
 
Sorry, I should have posted the code with the initial question.

Dim FirstDate As Date ' Declare variables.
Dim IntervalType As String
Dim Number As Integer
Dim newdate As String

If Option1(0) = True Then
IntervalType = "m" ' "m" specifies months as interval.
frmSelDate.Show 1
FirstDate = selDate

Number = 6
newdate = CStr(DateAdd(IntervalType, Number, FirstDate))

txtMedIssue = selDate
txtMedExpires = newdate
txtMedClass = "Class I"

End if

The three fields above are two text fields and a date field. Very strange that if I change value with the option box and then manually change another field on the form, all gets saved, but if I use only controls (option box, etc) nothing gets updated on save.

Below is the code on the save button.
Private Sub Save_Click()
datPrimaryRS.Recordset.UpdateBatch adAffectAll
Update_Splash.Show 1
cmdCancel_Click
Exit Sub

Thanks for looking at this.

-js
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top