Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Calendar Control    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Select Record Between Dates
James Hopkins 
     
8 months ago
Hey Richard and the Guys, I have a Reschedule Multiple Events by Week Form that I am using to Move Selected Records to a later Date. I am using the Check to "Select All" Record in the FormHeader of Continuous Form and Transparent Button over Checkboxes to Select and Unselect the Checkbox in the Continuous Form Detail Selection. The problem that I am having is that I am trying Select only the Record are within the Date Rate of the Current Week. What is the Best way to achieve this correct.
James Hopkins OP  @Reply  
     
8 months ago
Here's what I have in the Form Code:

Private Sub ChkSelectAll_Click()

    If Me.lblChkAll.Caption = "Select All" Then
        Me.lblChkAll.Caption = "Clear All"
        CurrentDb.Execute "UPDATE ScheduleT SET LnSelect = True WHERE ScheduleStartDate= #" & Forms!RescheduleMultipleEventByWeekF!WeekDate & "#"
    Else
        Me.lblChkAll.Caption = "Select All"
        CurrentDb.Execute "UPDATE ScheduleT SET LnSelect = False WHERE ScheduleStartDate= #" & Forms!RescheduleMultipleEventByWeekF!WeekDate & "#"
    End If
    
    Me.Requery
    
End Sub
Donald Blackwell  @Reply  
       
8 months ago
Are you trying to select all of the events in the form that are scheduled during the calendar week of the date selected or just all of the events scheduled for a week starting with the date entered?

First Day of Week shows how to get the first and last day of the week based on a date. So you could use that methodology to adjust your SQL to your needs if you want a calendar week. Otherwise, it would just be between StartDate and StartDate + 7.

Your SQL in the first method, your SQL might look like:

CurrentDB.Execute "UPDATE ScheduleT SET LnSelect = [TrueFalse] WHERE ScheduledStartDate Between #" & CalculatedFirstDayofWeek & "# AND #" & CalculatedLastDayofWeek & "#"

The second way might look like:

CurrentDB.Execute "Update ScheduleT SET LnSelect = [TrueFalse] WHERE ScheduleStartDate Between #" & Forms!RescheduleMultipleEventsByWeekF!WeekDate & "# AND #" & Forms!RescheduleMulptipleEventsByWeekF!WeekDate + 7 & "#"


Keeping in mind: Between includes the first date and ends 11:59pm on the date before the end date. Also, in my examples, replace [TrueFalse] with the appropriate value in the applicable part of your sub. Also, as your code is presented, it indicates that there is an "LnSelect" field in the underlying table, otherwise it won't know what you're trying to do.
James Hopkins OP  @Reply  
     
8 months ago
Thank Donald, you are right. I was going about it all wrong. Thank again!!!

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Calendar Control.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 8/13/2026 1:53:02 AM. PLT: 0s