Carry over date from previous record

Joined
Nov 21, 2014
Messages
3
Reaction score
0
I build a form where you enter a date, click submit which takes you into another form to enter all the other required information. To grab the value from the first form I set the default rule as followed =[Forms]![Date]![DateSelect]

Once I make my date selection I would like to keep it until I change the date manually or close the form out. but every time I add a record I get #Name error.

I have searched all over and tried different codes w/no success. Is there anyone who can help me?
 

Attachments

  • MS Database.png
    MS Database.png
    140.6 KB · Views: 247
  • MS Database2.png
    MS Database2.png
    104.7 KB · Views: 236
Joined
Dec 4, 2014
Messages
2
Reaction score
0
<< =[Forms]![Date]![DateSelect] >>

1. Change the default value to:
= getFilteredDate

2. Place the following function in a standard module (not in your form's module or any other class module):

Function getFilteredDate
getFilteredDate = Forms![Date].DateSelect

End function

3. Verify that the form and control names are indeed correct. The general syntax here is:
Forms!TheNameOfYourForm!TheNameOfYourTextBox

4. Is your form really named "Date"? If so it would be best to change it to something else, since Date is a VBA function/reserved word. Use a name like frmDateFilter instead.
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top