Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / July 2007

Tip: Looking for answers? Try searching our database.

Change Date Problem!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob V - 11 Jul 2007 07:34 GMT
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
Jerry Whittle - 11 Jul 2007 14:20 GMT
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.
Signature

Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

> 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
Bob V - 12 Jul 2007 00:30 GMT
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

> Hi Bob,
>
[quoted text clipped - 10 lines]
>> if I do it again the new date change stays on every second attempt!
>> thanks for any help here............Bob
Jerry Whittle - 12 Jul 2007 13:42 GMT
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.
Signature

Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

> 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
[quoted text clipped - 32 lines]
> >> if I do it again the new date change stays on every second attempt!
> >> thanks for any help here............Bob
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.