Solved

Access 2010 Loop to update date field

Posted on 2014-02-04
4
521 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:fargus47
  • 2
  • 2
4 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
0
 

Author Comment

by:fargus47
Comment Utility
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 119

Expert Comment

by:Rey Obrero
Comment Utility
<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:fargus47
Comment Utility
Thanks again Rey, it's really appreciated!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now