mjrobinson21987
New member
- Local time
- Today, 00:20
- Joined
- Aug 16, 2011
- Messages
- 4
Hello Forumers,
I've been trying to teach myself Access 2007 for a little while, and I come to you now seeking guidance on a problem I've been having.
I need to create a macro which validates a rule when the user goes to save the form. I'm trying to get it to say that if the request is for a business comp, than a patron number is required. (but not for a personal comp request)
the user selects business from a dropdown menu (choices are either business or personal), and the patron number is entered in a field which only accepts numbers.
I've been using the following code (and some variations of it, hoping it will work) in the conditions column of the macro builder:
([Forms]![Staff Comp Request Form]![Type of Comp]="Business") AND ([Forms]![Staff Comp Request Form]![Patron Number] Is Null)
So, my questions are this:
1. (I think the area in red is the part that needs to be changed) - How do I tell Access that Business is a value in the field? And will that also stop it from assuming that it also needs a patron number for personal comps?
2. Is this macro better placed in the save button (on click) or on the entire form (before update)?
Thank you so much in advance for any help you all are able to give!
I've been trying to teach myself Access 2007 for a little while, and I come to you now seeking guidance on a problem I've been having.
I need to create a macro which validates a rule when the user goes to save the form. I'm trying to get it to say that if the request is for a business comp, than a patron number is required. (but not for a personal comp request)
the user selects business from a dropdown menu (choices are either business or personal), and the patron number is entered in a field which only accepts numbers.
I've been using the following code (and some variations of it, hoping it will work) in the conditions column of the macro builder:
([Forms]![Staff Comp Request Form]![Type of Comp]="Business") AND ([Forms]![Staff Comp Request Form]![Patron Number] Is Null)
So, my questions are this:
1. (I think the area in red is the part that needs to be changed) - How do I tell Access that Business is a value in the field? And will that also stop it from assuming that it also needs a patron number for personal comps?
2. Is this macro better placed in the save button (on click) or on the entire form (before update)?
Thank you so much in advance for any help you all are able to give!