Change Date Problem!

B

Bob V

When the date appears in my text box on today's date and then I want to
change it to a new date , it turns black and today's date appears again, but
if I do it again the new date change stays on every second attempt!
thanks for any help here............Bob
 
J

Jerry Whittle

Hi Bob,

Check the code behind the form to see if there is something happening on an
event either on the entire form or that text field.

Other than that, maybe some table or form validation rule is messing with
things.
 
B

Bob V

Hi Jerry , The 2 text boxes that enter the date are cbRemark & tbRemark if
you enter data into them it puts todays date into dtDate
Its when you go to change that date to another when the problem
occurs..........Thanks for the Help...Bob

Private Sub cbRemark_AfterUpdate()
If cbRemark = "" Or IsNull(cbRemark) Then Exit Sub
Dim recRemarksAdd As ADODB.Recordset
Set recRemarksAdd = New ADODB.Recordset

recRemarksAdd.Open "SELECT * FROM tblRemarksAdd WHERE RemarkID='" _
& cbRemark.value & "'", CurrentProject.Connection, adOpenDynamic,
adLockOptimistic
If recRemarksAdd.EOF = True And recRemarksAdd.BOF = True Then
Exit Sub
End If
tbDate.value = Format(Now, "dd-mmm-yy")
tbRemark.value = recRemarksAdd.Fields("Remark")
recRemarksAdd.Close
Set recRemarksAdd = Nothing
End Sub
 
J

Jerry Whittle

Well it isn't so strange now. The code is changing the date. Not knowing the
business rules or what is being attempted, (plus I'm not much of a coder), I
can't really say what to do to change the code. The problem and solution is
in there somewhere though.
 
Top