Results 1 to 2 of 2
2003-04-15, 13:48 #1
- 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.
2003-04-15, 13:54 #2
- Join Date
- Mar 2002
- Thanked 28 Times in 28 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.