Solved

Access 2010 Loop to update date field

Posted on 2014-02-04
4
524 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
  • 2
  • 2
4 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
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…

775 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