- Local time
- Today, 13:04
- Joined
- Feb 19, 2002
- Messages
- 47,540
Where are you running the code? When you run the code in the form's class module, you should reference form fields by using "Me.yourcontrolname".
When you reference a form's control from a query or a different form, you reference the control as "Forms!yourformname!yourcontrolname"
If the Control is unbound, you need to tell Access that it is a date field by specifying a date format such as "short date". If the control is bound, it MUST be bound to a date data type in order for date functions to work. Some will work against strings but most expect an actual date data type.
When you reference a form's control from a query or a different form, you reference the control as "Forms!yourformname!yourcontrolname"
If the Control is unbound, you need to tell Access that it is a date field by specifying a date format such as "short date". If the control is bound, it MUST be bound to a date data type in order for date functions to work. Some will work against strings but most expect an actual date data type.