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 / ActiveX Controls / July 2004

Tip: Looking for answers? Try searching our database.

FAO: Alex Dybenko

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
K Crofts - 06 Jul 2004 15:33 GMT
Hi Alex, sorry to address this to you personally but you
seem to be the only person who understands my queries. i
have a form with a calender control. I need to be able to
click on the calender which transfers the selected date to
a textbox (''Date''). This then should automatically then
bring up the record for this date, if no record exists
then a new record is to be created for this date. I am
using the following code but as i am just starting out
with Access i have clearly got this wrong. Any ideas
appreciated.

Private Sub Calendar2_Click()
Me.Date = Me.Calendar2.Value
if isnull(dfirst("Date","Table content","Date=#" &
me.calendar2
& "#") )
'no record. go to new record
DoCmd.GoToRecord , , acNewRec
Else
   'position form on record with selected date
   Me.RecordsetClone.findfirst "Date=#" & Me.Calendar
& "#"
   If Not Me.RecordsetClone.EOF Then
       Me.Bookmark = Me.RecordsetClone.Bookmark
   End If
End If

End Sub

Thanks in advance
Alex Dybenko - 06 Jul 2004 20:17 GMT
Hi,
code looks almost ok, but few comments:

Me.Date = Me.Calendar2.Value - why do yo uneed this?

if you use DAO then following string:
If Not Me.RecordsetClone.EOF Then

should be
If Not Me.RecordsetClone.nomatch Then

HTH
Signature

Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

> Hi Alex, sorry to address this to you personally but you
> seem to be the only person who understands my queries. i
[quoted text clipped - 26 lines]
>
> Thanks in advance
 
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



©2009 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.