Display Current Date On Form

Parra

Well-known Member
Joined
Feb 21, 2002
Messages
752
I created a form. But when it opens, the first date from the table appears.

Is there a way where the current date could appear?

So today is 11/16/02 and this is what I would want to appear when the form is opened. Tommorrow 11/17/02. Any suggestions?

Thanks
 
Russell, are you understanding what he wants? It sounds to me like he's already got a record for each day, and he always wants the record with "today" as the date to open. You know I'm not Access guru, but I'm likening it to a search box in my form header, where the value searches the date field, and =DATE() would be the criteria ALWAYS.
 
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hey,

It sounds like you want the form to retrieve a record based on what you've entered in a date textbox. There's two relatively easy ways to accomplish this. I would open the form in design view, and add a combobox to the form. Use the wizard that pops up and tell it you want the form to retrieve a record based on what you've entered in the combobox.
You can then just leave the combobox, and either type in the date you want to retrieve. or select it from the drop-down list.
After you've done this, you can insert a textbox, and cancel the textbox wizard. Then right-click on the combobox and pull up the code. Change all the references to the 'lookup' dropcombo to refer to the textbox. This way, the textbox will retrieve a record based on what you've entered in it.

edit:
Oh yeah, add the date() formula to populate the text/combobox on the form to the initialize event, to recall a record for the current date.

HTH,
Corticus
This message was edited by corticus on 2002-12-20 14:42
 
Upvote 0
Thanks for the suggestions Dreamboat & Corticus, I thought I was not explaining myself well. But I see I am.

I'll take both of your suggestions and see what works best.

I'll keep you updated. This stupid thing I'm working on, is not even for my department. I don't know how I get sucked into things like this.

Thanks Parra
 
Upvote 0
A thousand apologies. I didn't realize that you wanted the record with the current date to appear. Sometimes I just don't get it...sorry for wasting your time.

rh
 
Upvote 0
From what I'm reading it looks like you have a table that already has all the dates entered. Each day you just go to that days record and input the data for the other fields in that record. If this is the case, all you need to do is make a query with all the fields from the table that you need to input. In the date field of the query set the criteria to be now(). Change the datasource of your form to be the new query instead of the table itself. An alternative is instead of putting now() as the criteria, you can put something like [Enter Date] as the criteria. When you open the form now it will ask you what date you want to see. Hope this helps.

Robert Hall
 
Upvote 0
OK, thanks for the help, I think I am finished now.

Russell, you didn’t waste my time. I appreciate you taking your time to help me.

In case you are interested in what I did, I’ll try my best to explain.

At first I applied a filter to my date field with the criteria =date(), this provided me with what I needed, but if the user needed to scroll back or forward, they would be unable to.

So then I used Dreamboats suggestion of adding a search button. Much easier, a window pops up, you enter the date, it goes to that record, do the data entry and your done and it also give you the ability to scroll forward and backward.

So I made this as simple for the user to use, but I am very sure that they’ll still have many problems with it.

Thanks to everyone (Russell, Dreamboat & Corticus) that helped me, Parra
 
Upvote 0

Forum statistics

Threads
1,221,497
Messages
6,160,151
Members
451,625
Latest member
sukhman

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