Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access 2010 Loop to update date field

Posted on 2014-02-04
4
Medium Priority
?
540 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 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

971 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