Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Increment date in tabular form

Status
Not open for further replies.

qwert85103

Technical User
Dec 27, 2003
162
US
hello,

I have a tabular form in which the starting field is date.

The way I want it to be is, for the first row, the user should enter date, then from the second row onwards, the date value should automatically get incremented by 1.

the fact that it will be an addition to date value, has made it even more complex.

thanks.
 
I am not really clear what you are asking for. But if you are just looking for a second date box to be one day more then the previous then all you have to do is add 1.

Example:
Date1= 'what ever value is entered
Date2 = Date1 + 1
etc......
 
How are ya qwert85103 . . . . .

Is this to occur for automatically for each record in the recordset or every new record entered?

Calvin.gif
See Ya! . . . . . .
 
For new records, you could try using the default value property of the control to carry over the date. For instance in the forms after update - or perhaps better, the forms after insert:

[tt]me("txtmydate").defaultvalue="#" & me("txtmydate").value+1 & "#"[/tt]

- if you're using regional settings where the date differs from the us date settings, you might have to format the date in us format (mm/dd/yyyy or yyyy-mm-dd)

Roy-Vidar
 
thank you guys!

RoyVidar I will try your suggestion and will let you know if it worked for me.

For those who needed clarification, I am so sorry I couldn't explain my prob clearly..so let me try to explain it again:-

I have a tabular form (just like excel sheet) with date, emp-id, start-time. the data is entered once per week.
say I am entering data for the coming week and I start with 8/17/2004 (its ok if I have to enter this first date), then when I get to the second row, the date should get filled automatically (incremented by 1).

I would appreciate your suggestions. Thanks in advance for your help.
 
RoyVidar,

I tried your code at form level, but it gave errors!
what could be going wrong?

thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top