Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Dynamically change design view from within VB code

Discussion in 'Information Technology' started by Jack, Nov 5, 2005.

  1. Jack

    Jack
    Expand Collapse
    Guest

    Hi,

    Is there a way to dynamically modify the design view of a form, query and
    report from within Access VB code? How? I would like to add and/or modify
    controls/fields in them according to records in a table that can be linked
    from a different database each time the program is run. In other words, the
    layout of the form/query/report would be specified by the records in those
    tables.

    Thank you for your help,

    Jack
     
  2. Loading...


  3. Brendan Reynolds

    Brendan Reynolds
    Expand Collapse
    Guest

    The query is easy - just modify the SQL property of the DAO.QueryDef object.
    The form and report, however, are ugly. You have to open them in design
    view, and use the CreateControl or CreateReportControl methods to create the
    control. This won't work in an MDE, using the runtime version of Access, or
    in a secured MDB where the user does not have modify design permission.

    It's easier to create as many controls as you need at design time, and just
    set the properties of the controls (Visible, ControlSource, etc.) at run
    time.

    --
    Brendan Reynolds


    "Jack" <nospam@nospam.com> wrote in message
    news:KXHaf.169$793.25@read3.inet.fi...
    > Hi,
    >
    > Is there a way to dynamically modify the design view of a form, query and
    > report from within Access VB code? How? I would like to add and/or modify
    > controls/fields in them according to records in a table that can be linked
    > from a different database each time the program is run. In other words,
    > the
    > layout of the form/query/report would be specified by the records in those
    > tables.
    >
    > Thank you for your help,
    >
    > Jack
    >
    >
     
  4. Louisec17

    Louisec17
    Expand Collapse
    Guest

    nope

    "Jack" wrote:

    > Hi,
    >
    > Is there a way to dynamically modify the design view of a form, query and
    > report from within Access VB code? How? I would like to add and/or modify
    > controls/fields in them according to records in a table that can be linked
    > from a different database each time the program is run. In other words, the
    > layout of the form/query/report would be specified by the records in those
    > tables.
    >
    > Thank you for your help,
    >
    > Jack
    >
    >
    >
     

Share This Page