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

form is continuous until next day then new records? 1

Status
Not open for further replies.

hlkelly

Technical User
Jul 11, 2003
108
0
0
US
I have a form where users will enter items based on returns that day. I'd like the user to be able to see all returns for that day but on the next day, the form would be empty and start fresh. I've set the form property to continuous so they can see everything and add as many returns as necessary in one sitting but I'm not sure how to go about making the form start over the next day.

Thanks.

Heather
 
I'm guessing that you have a date field on the form for the returns? If so set a filter for the form to be equal to the current date. I don't have any code written for this, but if you need it let me know.

John Green
 
Yes, I have a date field, which is automatically entered for them so there are no errors.

I'm very new to code, if you have something handy, I'd appreciate it. Otherwise, your turning me in the right direction has been a great help.

Thanks much!
 
All you need for your form is a filter.
The table, which your form is based on should contain a return_date field. This field will be filled automaticly when user enters a new record by the today date if you'll put in the "Default Value" property of the field the Date() function.
So, now you know when the entry has made, all you need is when you open the form to show the proper entries. You can do it this by creating this procedure:

Private Sub Form_Open(Cancel As Integer)
Me.Filter "return_date = Date()"
Me.FilterOn = True
End Sub

So, when the form opens, it will show only records for today.

 
Sorry, forgot to put "=" in : me.Filter = "return_date = Date()"
 
Thanks! It worked beautifully!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top