Home>

I am creating a split form to update an ACCESS record.
At the top, a single-cut form
At the bottom is a data sheet
However, it has a layout like that.

The data sheet and the cut form are each linked to the database.
When you select a data sheet, the single-cut form at the top will also change to the selected content.

【Thing I want to do】
I'd like to keep the above specifications and not be able to edit the datasheet at the bottom directly.
Something

  • Answer # 1

    "Split form data sheetYou can set the property to "read only".

    It's just an idea. I haven't actually done it so I don't know if I can do it.

    1. Get the coordinates of the control with focus in the API. Below is a sample. How to know the coordinates of the text control in the details of the form | Miyavi's Program Research Institute The sample link above is an MDB file and may not open. In that case, the coordinate position is acquired using the API in the same way below, so please refer to it. An improved version of the calendar dialog date input function --hatena chips

    2. From the coordinates, determine whether the focus is on the cut form side or the data sheet side of the split form.
    3. If it is determined that the data sheet side has the focus by the above method in the event when the control gets the focus, set the edit lock to "Yes" so that it cannot be updated. Set to "No" on the single-cut form side.
    that's all.