Layout-view changes on the client intake form
The intake form frmClient is bound to tblClients and opens in Form view. The department has asked for a quick round of changes and wants you to stay in Layout view because Design view, in their words, breaks the layout. The requests are: move Phone above Email; delete the Fax field; make ClientName in the form header bold and larger; highlight any record where RenewalDate falls within the next 30 days; show a calculated Balance (TotalBilled minus TotalPaid, both already in the record source); add the company logo to the header; and stop the controls from overlapping when the form is maximised on a 27-inch monitor. Right now every control sits in a stacked layout, and the title text box lives in the Detail section because the form has no header section at all. Two technicians open the form at 125 percent Windows scaling and see different spacing.
1. Classify each requested change as doable in Layout view or requiring Design view, and justify the split.
Read the worked answer
Layout view is live and data-aware: it renders real records while you resize, drag, format and apply conditional formatting. Design view is structural.
Doable in Layout view:
- Moving Phone above Email - dragging controls within a layout reorders them.
- Deleting Fax - select and press Delete.
- Bold and larger ClientName - formatting is a Layout view task.
- Conditional formatting on RenewalDate - the Conditional Formatting command is on the Format tab in Layout view.
- Adding the logo - Insert Image works in Layout view.
- Adding a calculated Balance text box - type
=[TotalBilled]-[TotalPaid]into an unbound control's Control Source in the Property Sheet, which Layout view exposes.
Requires Design view:
- Tab order. The Tab Order dialog is only on the Design tab in Design view; Layout view does not expose it. Keyboard sequence is structural.
- The header section. Creating a form header/footer is a Design view operation. Once the header exists, its controls are formatted in Layout view like any other.
So: do the cosmetic and field work in Layout view, then switch once for the header and the tab order.
2. Controls overlap when the form is maximised and spacing differs between workstations. Diagnose and fix.
Read the worked answer
Two separate causes. The overlapping is the stacked layout: a stacked layout stretches its rows to fill the form, so on a large monitor each row becomes tall and tall controls push into their neighbours, or a control that ignores the stretch overlaps one that does not. The differing spacing at 125 percent scaling is Windows text scaling - Access does not scale a form's absolute positions the way it scales fonts, so a layout built with fixed positions will drift.
Fixes, in order:
- Anchor controls. Select the controls and set Anchor to Stretch Down and Right, or Stretch Down for a single-column form, so growth is distributed instead of piling up.
- Use the layout rather than fighting it. Keep the stacked layout for the field column, but remove the layout from grouped controls (Arrange > Remove Layout) so each cluster floats independently.
- Set the form's size policy. Set Auto Resize = Yes, and either set the form's border to Dialog with a fixed size, or set Moveable = No and accept maximising.
- Test at 125 and 150 percent, because that is where the two technicians live. If exact geometry matters, add a small amount of padding inside the layout rather than tightening the spacing.
Avoid the temptation to nudge controls in Design view to fix one monitor; it breaks on the next one.
3. Write the conditional formatting rule for the 30-day renewal highlight and explain how you would validate that it fires correctly.
Read the worked answer
Select the RenewalDate control (or the whole row of controls, applied individually), open Conditional Formatting, add a rule, choose Expression Is rather than Field Value Is, and enter:
[RenewalDate] Between Date() And DateAdd("d",30,Date())
Points that matter:
- Use Expression Is because the test spans a range relative to today, which Field Value Is cannot express as a moving target.
- The expression must evaluate to True or False. If RenewalDate is Null, the comparison yields Null, which is treated as not-true, so empty dates stay unhighlighted - correct behaviour, but worth knowing.
- Use
Date(), notNow(); the latter includes a time component and would exclude a renewal dated today at 00:00. - To highlight the whole row, apply the same rule to each control; conditional formatting is per control, not per record.
Validation: temporarily set the rule's fill to a vivid colour, then sort the form by RenewalDate and check the boundary rows - yesterday (not highlighted), today (highlighted), exactly 30 days out (highlighted), 31 days (not), and a Null (not). Test with the system clock in mind: a rule that only works on weekdays has a date function bug, not a formatting bug.