Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a form with a sub form. In one circumstance - where an employee already exists - I want the sub-form display to be continuous forms; in another situation, that of inputting a new employee, I want the sub-form display mode to be single form ie the user must only be allowed to enter one record.
    I have tried to set DefaultView from VB but get an error saying it must be set in form design mode.
    I have tried setting AllowAdditions to No, but this results in not being able to input any data into the blank record which is displayed on form opening.

    Is there a way to switch display modes for this sub-form dynamically, or is the only solution to duplicate the form/subform, this time with the sub-form DefaultView set to SingleForm, and use it for the special situation of entering a new employee?

    Thanks
    Silverback
    Silverback

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You cannot switch between single form view and continuous forms view.
    You could place two subforms on the main form - one set to single form, the other to continuous forms, and toggle the visibility of the subforms as needed.

  3. #3
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Alternatively, you could
    just change the subform that appears in the subform Control,
    by changing the Control Source Property of the sub form control at run time.
    You would need one subform in tabular layout and one in columnar.
    This means you would not have to have 2 subforms on the main form, both being populated
    with data.
    You would need to possibly try both and see which method gave the fastest response time.

    Or you could have a subform in Columnar View and switch it between single form and datasheet view.

    See attached example that has a form that changes the subform in a control.
    It uses a button, but it could be changed by some other event.

    [attachment=86417:ChangeSubs.zip]
    Attached Files Attached Files
    Andrew

Posting Permissions

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