473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Auto Date in form "pages"

29
I have a form set up like a journal

the top of the page has

2 fields

dateID {autonumber)
Date (date/time)

under these there is a subform with ny notes section

i would like to have the date change from todays date to tommorrows date on the next page

how do i do this
Dec 30 '08 #1
6 1556
janders468
112 Expert 100+
This depends on what you mean by change page, and how you are doing that. It sounds like you need to respond to whatever event a page change is and populate the appropriate control or record with today's date. the Functions Now or Date will return today's date. If you add a few more details we can probably zero in on what you need.
Dec 30 '08 #2
frys
29
first off thanks for replying


2nd

i think what i am getting at is

i want 2 forms. they are:

1 main for and a sub form
on the main form i have a date box call it txt_date
further down the form is a sub form called Subform_Memo

when ever i click to a new record on the main form i want the date to be 1 day after the last record

i never want a day to be missed so a default value of Date() wont work. also i never want a date to repeat so there should never be 2 December 29 2008 ... so i indexed the field making duplicates allowed (no)

they real issue i have is that the next record of the main form as of writing is not taking the next possible day ie December 30th 2008

i hope im being clear enough i am having trouble explaining it:)

if i click new record 3 times in a row the date should change from
December 29
December 30
december 31

etc even if the date is december 29th
Dec 30 '08 #3
janders468
112 Expert 100+
You can create a variable that holds today's date when the form opens. Then whatever triggers a new record or page change can increment this variable i.e.
Expand|Select|Wrap|Line Numbers
  1. dim dte as date
  2. sub form_open
  3.      dte = date
  4. end sub
  5.  
  6. sub newpage()
  7.      dte = dte + 1
  8. end sub
  9.  
If today's date is too general as a starting point you can populate the variable from wherever you are storing the dates (i.e. the maximum date value from the table the dates are contained in).
Hopefully I understood you correctly, if not, let me know and I'll try again ;-)
Dec 30 '08 #4
frys
29
hate to sound new to VbA but it has been a while

If i put that code in the On load event i get an error.

i dim dte as date over the sub
enter the code in the sub and then end the sub

but it is popping up error

i should pull out my books and reread the coding sections


but it looks like that might work.. only thing i want it to do is call the last date entered and add 1 day so i never miss a day even if i havent opened it in 3 days i need to be forced to fill in the missing days
Dec 30 '08 #5
janders468
112 Expert 100+
What does the error message say?
Dec 30 '08 #6
missinglinq
3,532 Expert 2GB
I think this will do the job. Where

TableDateField is the field that txt_Date is bound to

and

YourTable is the actual name of your underlying table

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. If Me.NewRecord Then
  3.   If IsNull(DMax("[TableDateField]", "YourTable")) Then
  4.    Me.txt_Date = Date
  5.   Else
  6.    Me.txt_Date = DMax("[TableDateField]", "YourTable") + 1
  7.   End If
  8. End If
  9. End Sub
Linq ;0)>
Dec 31 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John Baker | last post by:
Hi: Can someone answer the following questions about "Pages" a. Are they are good way to develop web based access applications? b. Is there a good manual like "Pages for Idiots" which will...
6
by: José Joye | last post by:
Hello, I'm currently reading the MS Developing Web applications with c# (and VB.net). In the chapter related to Error management, there is a sample about "Page-Level Error Pages" eg: In my...
3
by: Nils Magnus Englund | last post by:
Hi! I'm playing around with Wilson's master pages for ASP.NET 1.1. It seems ok, but I'm really struggling with the following two problems: 1) I want all .aspx pages to inherit from the same...
1
by: Twister | last post by:
hello, I would like to print report with OnPrintPage event and after that add footer "Page X of Y" to every page (because then i would know how many pages there are). How can I do that ? ...
2
by: Wade | last post by:
Hi all, We have created some "Base" class pages for our WebForms and UserControls. For instance, when we create a WebForm called "WebForm1.aspx", instead of inheriting from "System.Web.UI.Page"...
2
by: Ed Staffin | last post by:
In Internet Explorer under the tools/internet options menu on the general tab, there is a settings button under Temporary internet files. In there the user can specify when to "Check for newer...
1
by: b ramgopal goud | last post by:
Any body can please help me ??? With IE6 browser and hhtps, "xml" pages are not displaying , But in http why
4
by: (PeteCresswell) | last post by:
"Pages" as in the web page UI to an MS Access back end. Just had a lunchtime discussion with a couple of co-workers and none of us have been able to actually use a "Page".... but our experiences...
33
by: Manikrag | last post by:
Hi Team, I have to adjust two pages which are provided by 2 diff. services based on some query string, as of now I am using iframes but could not set the height dynamically. Both the child pages...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.