Time for another Microsoft Access video quiz. This one is aimed at expert-level Access users and covers a handful of form, query, and date-calculation situations that can easily trip people up. Give each question a shot before revealing the answer. No peeking. Your future self will be disappointed.
These questions focus on a callback system, where contacts can be marked for follow-up, filtered into callback lists, and opened with forms and buttons. They also cover an important little detail about hiding bound controls on a form. Let's see how you do.
Question 1: A callback list shows only records where Must Callback is set to True. The call has been completed, but the notes from that call need to remain in the contact table. What should you do before reopening the callback list?
Should you delete the contact record, clear the Must Callback checkbox, clear the callback date or set it to yesterday?
Answer: Clear the Must Callback checkbox.
The callback list is filtered based on that Yes/No field. Once the follow-up is complete, clearing the checkbox removes the contact from the active callback list without deleting the contact or losing the notes. Deleting records just because someone returned a phone call is a little like throwing away your address book after sending a birthday card.
Question 2: A button reads a bound Customer ID text box on a form. What happens if you set that text box's Visible property to No?
Is the stored Customer ID erased? Does the button have to use the customer's name instead? Does the text box become unbound? Or can the button still read the Customer ID?
Answer: The button can still read the Customer ID.
Making a bound text box invisible only hides it from the user interface. It does not erase the value, remove the field from the form's record source, or magically unbind the control. VBA and macros can still refer to the control and retrieve its value normally. This is a common and useful technique when you need an ID value available behind the scenes but do not want users typing into it or even seeing it.
Of course, hidden is not the same as secure. If you need to protect sensitive data, do not assume an invisible text box is Fort Knox. It is simply hidden on that form.
Question 3: You change a default value expression from =Date()+1+(14/24) to =Date()+1+14. What does the revised expression return?
Your choices are tomorrow at 2 PM, midnight 14 days from today, midnight 15 days from today, or today at 2 PM.
Answer: Midnight 15 days from today.
In Access date math, whole numbers represent whole days. The original expression starts with today's date at midnight, adds one day, then adds 14/24 of a day, which is 14 hours. That gives you tomorrow at 2 PM.
But when you replace 14/24 with just 14, Access treats that as 14 additional days. Add the original one day, and you are now 15 days ahead, at midnight. Decimal portions represent time; whole numbers represent days. Tiny difference in typing, very different callback date.
Question 4: A callback form uses a query that selects only records where Must Callback equals True. The button that opens the form says, "Open the form and show all records." Which records actually appear?
Will you see only the records returned by that query, every record in ContactT, only records selected on the main menu, or no records until the button adds another filter?
Answer: Only the records returned by the query.
The form's record source controls the available records. If the form is based on a query that already limits records to Must Callback = True, then "show all records" means all records from that query, not every record in the underlying contact table.
This is an important distinction when working with forms. A button can remove a filter that was applied to a form, but it cannot override the criteria built directly into the form's record source. If you need access to every contact, you need a form or query designed to return every contact.
Question 5: A query displays ContactT.* plus a separate CallbackDateTime column that is sorted ascending. The callback date appears twice in the results. How can you keep every field from ContactT, keep the sort, and display only one callback date column?
Your choices are clearing Show for ContactT.*, removing the separate CallbackDateTime column, sorting ContactT.* ascending, or clearing Show only for the separate date column.
Answer: Clear Show only for the separate CallbackDateTime column.
When you use ContactT.*, Access displays every field in that table, including CallbackDateTime. If you also add CallbackDateTime as its own column so you can sort by it, you will see it twice unless you hide one of them.
The trick is to leave the separate CallbackDateTime field in the query grid, set its Sort row to Ascending, and clear its Show checkbox. Access can still sort on a field that is not displayed. That lets you keep all fields from ContactT, retain the correct sort order, and avoid duplicate columns in the result.
How did you do? If you got all five, congratulations: your callback continuum is intact, your hidden IDs are still working, and your dates have not accidentally traveled two weeks into the future. Watch the embedded video for the complete quiz, and if any of these questions gave you trouble, the related Access Expert Level 3 lesson on building a callback form goes into the details.
Live long and prosper,
RR
No comments:
Post a Comment