Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Sep 2002
    London, England
    Thanked 0 Times in 0 Posts

    Can I change datamode of open form? (2000)

    I think the answer to this is no, but here goes anyway. Can I change the datamode of a form once that form is open? I am adding a check to a contacts manager to ensure that new contacts do not already exist in the database. The contact details page opens in Add mode and, once enough details have been entered to check for duplicates, I want to offer the user the option of switching to a pre-existing record if a duplicate is found. Everything works except that I end up with a blank form after changing the form's record source to point at the pre-existing record. I suspect that this is because the form was originally opened in Add mode.

    If I can't I guess the solution is to close the form then open it again.

    Thanks for the tips on modal forms and print preview by the way and, yes, it looks as though I did ask the same question twice. Many apologies.


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Can I change datamode of open form? (2000)

    Yes, you can change properties like AllowAdditions, AllowEdits, AllowDeletions and DataEntry in code:

    Me.DataEntry = False

    to allow viewing existing records, or

    Me.DataEntry = True

    to allow only new records, or

    Me.DataEntry = Not Me.DataEntry

    to toggle the data mode.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts