Others

Select the Correct Record with a Button in an Access Continuous Form

John WilsonJohn Wilson Nov 18, 2026 870 views

Question details

Select the record containing a clicked control before running an action in an Access continuous form.

Select the Correct Record with a Button in an Access Continuous Form
Product
Microsoft Access
Device & OS
not provided
Scenario
A continuous form displays an image or button for each record, and clicking it should open or query data for that record.
Observed behavior
Clicking the control uses the first record instead of the record containing the clicked control.
Before you start

Open the continuous form in Design View and confirm that its record source includes the key field, such as Auto_ID. Check that the related form also has a field that can be used to filter the matching record.

Solution 1Recommended

Place a transparent command button over the image

Use a focusable button to select the clicked record and run an action with its current key.

1
Add a command button

Open the form in Design View, select Design > Button, and draw a button over the image in the form's Detail section. If the Command Button Wizard opens, cancel it.

2
Make the button transparent

Select the button, open its Property Sheet, and set Transparent to Yes on the Format tab. Use Arrange > Bring to Front so the button sits above the image.

3
Create the click event

In the button's Property Sheet, open the Event tab, set On Click to [Event Procedure], and select the build button (...) to open the VBA editor.

4
Open the matching record

Between the generated Sub and End Sub lines, enter: DoCmd.OpenForm "DB_Notes", , , "Auto_ID = " & Me!Auto_ID. Replace DB_Notes and Auto_ID with your form and key field names if needed.

5
Test multiple records

Save the form, switch to Form View, and click the image area on several records. Confirm that the related form opens with the matching record each time.

Place a transparent command button over the image
Check the key type: The example assumes Auto_ID is a non-null numeric field available in the current form and in the related form's record source. A text key requires quotes and appropriate escaping in the filter.
Free Microsoft Office alternative

Manage tabular data with WPS Spreadsheets

WPS Office is a free, lightweight alternative for working with office files in a familiar interface. Open compatible Microsoft Office files to move everyday document and spreadsheet work to WPS. It does not run Access forms or fix Access-specific behavior.

Organize and review tabular records in WPS SpreadsheetsOpen and edit Microsoft Excel XLS and XLSX filesUse a familiar interface for everyday office tasksWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Access form use the first record when I click an image?

The image click may not move focus to the record you clicked, so code that reads the current record can use a different record. Place a command button over the image and run the action from the button's On Click event.

Where do I enter the code for the transparent button?

In Design View, select the button and open Property Sheet > Event. Set On Click to [Event Procedure], select the build button (...), and add your code inside the generated VBA procedure.

How does the button open the record with the matching Auto_ID?

The button's Click event can use DoCmd.OpenForm with a WhereCondition, such as "Auto_ID = " & Me!Auto_ID. The example requires a numeric Auto_ID in both the current form and the related form's record source.

Can I click the image directly instead of using a button?

An image may need to be bound to a field so Access can focus the correct record. If direct image clicks do not select the expected record, use a transparent command button over the image and test it on several records.