Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access 2010 Loop to update date field

Posted on 2014-02-04
4
Medium Priority
?
538 Views
Last Modified: 2014-02-05
Hi Experts,

I'm trying to find a way to use a date (input from form) to update the date records in a table.  Using the start date provided by the user, the date records in the table should be updated in sequence but the first date for SunWk1 would equal the user provided date.  The order of the records is important; it is for a menu that is 28 days long and starts with SunWk1 through SatWk4.  I've tinkered with a loop but can't figure out how to have each date correspond to the order of the menu days.  I read that I should use a query to order the menu days but these are static (meaning they will not be changed) and can't figure out how a query will sort the fields.  I've attached the form and table that are affected.  Thank you in advance for any help!
Sample-Database.accdb
0
Comment
Question by:Skip Sleeper
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 39834243
0
 

Author Comment

by:Skip Sleeper
ID: 39834384
Hi Rey,

This is perfect--thank you!  Could I ask a few questions?

What is the variable "j" for?

What is the significance of "vbSunday"--is this a reserved word in VBA?

Does the cmd MoveFirst start at the beginning of the list?

Thanks again!
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39834391
<What is the variable "j" for? > nothing, I did not use it. you can delete it.

<What is the significance of "vbSunday"--is this a reserved word in VBA?> Yes, it is a constant for "Sunday" and has a value of 1, first day of the week.


<Does the cmd MoveFirst start at the beginning of the list?> yes, first record of the recordset.
0
 

Author Comment

by:Skip Sleeper
ID: 39835497
Thanks again Rey, it's really appreciated!
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question