• record locks

    Author
    Topic
    #356093

    hi all
    is there a way to prevent the user from scrolling through records? i have a form in which the user enters information, and i don’t want them to go to other records (the form opens and then goes to “add new record”). should i be approaching this differently for a form that only enters information?

    Viewing 1 reply thread
    Author
    Replies
    • #526401

      in the forms properties set the cycle property to current record instead of all records

      • #526402

        sounds like that should work, but when i changed it to that absolutely nothing changed….. i could still scroll through records hmmn

    • #526430

      I’d make a copy of the form you have and set it in design view for Data Entry so that it doesn’t load all the records and merely allows new entry. I’d put this form in an autoexec macro so that it opens for the user when the db is first opened.

      • #526436

        I avoid the problem entirely by forcing the user to select a record (usually with an unbound combobox) and then setting the form’s recordsource to a select statement that returns only that record. They have nowhere to scroll then, and setting the Cycle property to current record keeps them from accidentally creating a record by tabbing through the end of the current one or using the page down key.

        The trick to this is in loading the form itself with an empty recordset. You do that by setting the default recordsource property to a statement that always evaluates to false, like “SELECT * FROM MyTable WHERE 1=2”. That allows you to bind all the controls to the appropriate fields but doesn’t load any records. When you reset the recordsource in code, you get the record returned by the new select statement.

    Viewing 1 reply thread
    Reply To: record locks

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: