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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Beginner access question 1

Status
Not open for further replies.

PBXJay

Technical User
Jan 4, 2002
378
US
I haven't worked in access in years.
On my form I want to allow the user to add a date but also be able to instead click on a button that autopopulates the date field with current date to save time if the event is from today.

I know it is possible and not difficult. But what is the cleanest/easiest way to set this up? Macro or On click button?

Thanks in advance
 
I'd use a click button event and just set the value of the field to =Date

which will bring in today's date from the clock.

John
 
Thanks, they can also type into the field as well and fill out the data manually right?
 
How are ya PBXJay . . .

Instead of the button you can instruct the users to hit [blue]Ctrl + :[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
Any thing I can do to not have to train will be better-----there will be a different group of people and the msg may not be passed on.
 
stupid question Jill, how do I create the click button event?

I did a command button button where do i set the on click?
 
In the design view of the form right-click over the command button and select Build Event... Next click Code Builder.

Alternatively open the properties window for the command button, go to the events tab and click the elipsis button next to the On Click event.

Ed Metcalfe.

Please do not feed the trolls.....
 
Thanks... Sorry for the denseness and the need to be spoon fed :)


When I created command button I had to chose one of the wizard options ie. open form etc. Do I just eliminate all the vb code there and set my date field?

field to =Date
 
Remove all the code except the first and last line and replace with:

Code:
    Me.<ControlName>=Date()

Ed Metcalfe.

Please do not feed the trolls.....
 
PBXJay . . .

You can have a [blue]tool tip[/blue] appear (instructing the keys to hit) whenever they hover the mouse over the ctl! . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
How about one more stupid question....

I have a dropdown box based on table Department

I have another dropdown box based on Table Name

I have a key matching Department and Name ie if department is Computer key = CM and in the Name table that person has CM key in their row as well.

How do I pass the department to the second dropdown box to filter the list? Do I link it to a querry?

Thanks again.
J
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top