Feedback shouldn’t be a puzzle
What you’ll build
Table:
tbl_Feedback
(stores each submission)Form:
frm_Feedback
(easy data entry with a dropdown rating and a comment box with a disappearing placeholder)Buttons: Save, New, Clear, Close
(Optional): Simple query and a summary report
1) Create the table
Navigation: Create ▶ Table Design
Add these fields:
Field Name | Data Type | Notes |
---|---|---|
FeedbackID | AutoNumber | Primary Key |
DateSubmitted | Date/Time | Default Value: Now() |
Username | Short Text (50) | Optional prefill with Windows user |
Category | Short Text (30) | e.g., Bug, Idea, General |
Rating | Number | Field Size: Byte (1–5) |
Comments | Long Text | (aka Memo in older Access) |
Validation (at table level):
Rating → Validation Rule:
Between 1 And 5
Validation Text:
Please select a rating between 1 and 5.
Set Required:
Yes
forRating
, others as you prefer.
Optional – Create with SQL (Access DDL)
CREATE TABLE tbl_Feedback (
FeedbackID AUTOINCREMENT PRIMARY KEY,
DateSubmitted DATETIME DEFAULT Now(),
Username TEXT(50),
Category TEXT(30),
Rating BYTE,
Comments LONGTEXT
);
In older Access, replace
LONGTEXT
withMEMO
.
Save the table as tbl_Feedback.
2) Build the data entry form
Navigation: Create ▶ Form Wizard → Pick table: tbl_Feedback
→ Add all fields → Finish. Save as frm_Feedback.
Switch to Design View and polish:
A) Rating input (choose one)
Option Group (radio buttons)
Design ▶ Option Group → Drop on form.
Add options:
1
,2
,3
,4
,5
→ Assign values 1–5.Control Source of the option group:
Rating
.
OR, Combo Box (dropdown)
Insert Combo Box → Control Source:
Rating
.Row Source Type:
Value List
.Row Source:
1;2;3;4;5
.Limit To List:
Yes
.
B) Category dropdown (quick value list)
Row Source Type:
Value List
Row Source:
Bug;Idea;General;Other
Limit To List:
No/Yes
(your choice)
C) Comments with a disappearing placeholder
Name the comments textbox txtComments (Control Source = Comments
). Add this VBA in the form’s code module:
Option Compare Database
Private Const kPlaceholder As String = "Type your feedback here…"
Private Sub Form_Load()
' Show placeholder if empty
If Nz(Me.txtComments.Value, "") = "" Then
Me.txtComments.ForeColor = RGB(150,150,150)
Me.txtComments.Value = kPlaceholder
End If
' Prefill username from Windows (optional)
If Nz(Me.Username.Value, "") = "" Then
On Error Resume Next
Me.Username.Value = Environ$("USERNAME")
On Error GoTo 0
End If
End Sub
Private Sub txtComments_GotFocus()
If Me.txtComments.Value = kPlaceholder Then
Me.txtComments.Value = ""
Me.txtComments.ForeColor = vbBlack
End If
End Sub
Private Sub txtComments_LostFocus()
If Nz(Me.txtComments.Value, "") = "" Then
Me.txtComments.ForeColor = RGB(150,150,150)
Me.txtComments.Value = kPlaceholder
Else
Me.txtComments.ForeColor = vbBlack
End If
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
' Don’t save the placeholder text to the table
If Me.txtComments.Value = kPlaceholder Then
Me.txtComments.Value = Null
End If
End Sub
D) Buttons (Save / New / Clear / Close)
Add 4 command buttons and name them: btnSave, btnNew, btnClear, btnClose. Paste this VBA into the form’s code:
Private Sub btnSave_Click()
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Thanks! Your feedback was saved.", vbInformation
DoCmd.GoToRecord , , acNewRec ' auto‑ready for next entry
End Sub
Private Sub btnNew_Click()
DoCmd.GoToRecord , , acNewRec
End Sub
Private Sub btnClear_Click()
Me.Undo
End Sub
Private Sub btnClose_Click()
DoCmd.Close acForm, Me.Name
End Sub
Tip: Set Default = Yes
for btnSave to trigger on Enter. Set Cancel = Yes
for btnClose to trigger on Esc.
E) Nice touches
Add a Form Header with title: “Feedback Form” and a brief instruction label.
Set Tab Order: Username → Category → Rating → Comments → Save.
Set Cycle (Form property) to
Current Record
to prevent jumping to new records by accident.
Save the form.
3) Simple validation and UX
Table-level rule already restricts
Rating
to 1–5.(Optional) Limit comment length in
Form_BeforeUpdate
:
If Len(Nz(Me.txtComments, "")) > 1000 Then
Cancel = True
MsgBox "Please keep comments under 1000 characters.", vbExclamation
End If
(Optional) Make
DateSubmitted
read-only on the form (Locked = Yes) so users don’t change the timestamp.
4) Quick query and summary report (optional)
Query: Create ▶ Query Design → Add tbl_Feedback
→ add fields → sort.
SELECT DateSubmitted, Username, Category, Rating, Comments
FROM tbl_Feedback
ORDER BY DateSubmitted DESC;
Report: Create ▶ Report Wizard → Use the query → Group by Category
→ Add Average of Rating in the group footer with a textbox:Control Source: =Avg([Rating])
5) Start-up & distribution (optional)
File ▶ Options ▶ Current Database → Display Form:
frm_Feedback
.Consider Compact & Repair before sharing.
If multiple users will enter data, split the database (front-end / back-end) via Database Tools ▶ Access Database.
Troubleshooting
Option group not saving? Ensure the Control Source of the option group (not the individual buttons) is
Rating
.Combo not saving? Set Bound Column =
1
and Column Count =1
.Placeholder saved in table? Confirm the
Form_BeforeUpdate
code runs and the comments textbox is named exactlytxtComments
.
You’re done!
Open frm_Feedback and try a test entry. You now have a simple, robust feedback intake form you can post or share with your team.
Comments
Post a Comment