Share via

Continuous Form Current record

Anonymous
2013-06-27T15:50:35+00:00

In a continuous form there is an On Enter Event.

I need this to occur only on the current record.

But it executes on all the records in the continuous form!

Without going through Cloning the recordset, find first etc, is there any way this code could be modified (like adding a qualifier)  so that it is executed only in the single current RECORD of the continuous form? The following is the copy of the code:

                        Me.Text27.Visible = True

                        Me.Label28.Visible = True

                        Me.Text27.SetFocus

Thanks

HNIM2010

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2013-06-27T16:36:41+00:00

A continuous form contains only a single set of controls that is used to display all records. If you apply formatting to a control (for example set its Visible property to True or False), it applies to all records in the form simultaneously.

The only exception is conditional formatting - you can change some properties of text boxes and combo boxes depending on the data in the record or on whether the control has the focus.

You can change:

  • fill color
  • font color
  • bold, italic, underline
  • enabled/disabled

As you see, visibility is not among these properties: you can't hide/unhide a control using conditional formatting, only disable/enable it.

Was this answer helpful?

0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2014-09-25T02:06:12+00:00

    Thank you for sharing your code.

    It is clear, simple to apply and effective.

    Not only does it work efficiently, there is lots of room to add extra controls for error trapping.

    Thanks again.

    Stephen McK

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2013-06-27T16:42:07+00:00

    That is very helpful and  clarifies a lot!

    Thank you again Hans

    HNIM2010

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2013-06-27T16:41:13+00:00

    You cannot show/hide controls independently in different rows of a continuous form.  Each row is an instance of the same set of controls, so hiding them in one row hides them in all rows.  You can disable/lock the text boxes in all bar a new row by putting code in the form's Current event procedure:

        If Me.NewRecord Then

            Me.Text27.Enabled = True

            Me.Text27.Locked = False

               Me.Text27.SetFocus

         Else

            Me.SomeOtherControl.SetFocus

            Me.Text27.Enabled = False

            Me.Text27.Locked = True

        End If

    Was this answer helpful?

    0 comments No comments