Good Morning. I am working with Access 2010 on Windows XP. I am building a form for an internal team of mine that tracks outliers within a line of business.
When a person goes to a break/lunch/leaves for the day, they are required to hand off the business they are watching to a co-worker with comments.
I would my staff to be able to fill out all fields up to comments as a new record each time. IF they select a name from the Handed Off To list, COMMENTS must be filled out and submitted as a new records.
These 2 options must be indepedent of each other. Any help in accomplishing this would be helpful.
Here is some additional info that might help:
Form Name: Daily Log Form
Record Source: Daily Log Table
Analyst Name = Analyst
Line of Business Name = Line Of Business
Day Name = Day
Time Name = Time
Comments Name = Comments
Handed Off To Name = HandedOffTo
Handoff Comments Name = HandoffComments
Add Entry Button Name = AddEntryButton
IF they select a name from the Handed Off To list, COMMENTS must be filled out and submitted as a new records.
I'm not sure to understand what you mean here.
For the rest, you can always scan all the textbox controls on the form and check that they are not empty:
Dim ctl as Control
For Each ctl In Me.Controls
If ctl.ControlType = acTextbox Then
If Len(Nz(Ctl.Value, "")) = 0 Then
MsgBox ctl.Name " & cannot be empty.", vbExclamation, "Empty value"
In this example, a simple message box is used but you can manage what needs to be done in such situation in any way you see fit.
There are two things that could happen in this form. 1) The will fill out everything up through comments and it will be a NEW record 2) When they hand of the business to a co-worker, they will specify who they handed it off to and their comments and that will also be a NEW record
One of the validation rules I would like is to stop the new record from being added if they select a name from the Handed Off To combo box and no comments are left. If the select a name they HAVE to leave comments.