HELP!! DATE TOPIC

Anvil

New Member
Joined
Nov 22, 2002
Messages
2
Here's my problem: I have a typical table with several columns and one of them is "Date". The thing is, for each day (for instance the 30th of november) I have to write down like 40 registers.

And the question is: can I do something like "From now on, and until I change it, the value of this column is going to be "1st of november", so that I do not waste valuable seconds of my time writing down "30/11"? every time I get to that columns? How is that possible in Access?

Thanks

Anvil
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Go into your table and make the default day be what you want for that month (easiest for me!).

However, you could probably get some code that might do that automatically.

If it were me, I'd just change the default date in the table.
 
Upvote 0
You can also assign the value to the date you are actually entering the data by putting

=Date()

In the default value for that field in Table Design View. But it sounds like this is probably not the case for you, so Dreamboat's suggestion will be better.

-rh
 
Upvote 0
Hi,

I've accomplished this the following way.

You will need to access the table through a form. Use the form wizard and include the necessary fields. In the form properties, make the navigation buttons not visible. Then in design view, add three buttons to the form. Use the wizards. Make one button and next record button, one a last record button, and one a new record button. This way, you have to click the button the navigate through the records and you can capture this action.

Name the texbox linked to the date field TxtDate.

Right click on the 'next record' button and select 'build event'. Add:
CopyDate = TxtDate
right before:
DoCmd.GotoRecord,,acNext
so it looks like:
NextButton_Click()
Dim CopyDate as Date

CopyDate = TxtDate
DoCmd.GotoRecord,,acNext
TxtDate = CopyDate

End Sub

Do the same for the new record button like:
NewButton_Click()
Dim CopyDate as Date

CopyDate = TxtDate
DoCmd.GotoRecord,,acNew
TxtDate = CopyDate

End Sub

Let me know if you need more :)

HTH,
 
Upvote 0

Forum statistics

Threads
1,221,490
Messages
6,160,133
Members
451,622
Latest member
xmrwnx89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top