Automate generation and distribution of forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • audrey.nsh@gmail.com

    Automate generation and distribution of forms

    Hi,

    I have an Access 97 database where the users loads the data (from
    multiple sources) and generates forms (that looks like reports) at a
    click of the button and the user saves the form as .xls and
    distributes to other users via e-mail.

    I need to automate the process of generating the forms, saving the
    report and distributing to other users via e-mail

    Can someone guide me in the right direction?

    Thanks,

    Audrey
  • KC-Mass

    #2
    Re: Automate generation and distribution of forms

    Hi,

    I have never done this with Forms (always with Reports).

    Anyway try something like this air code:

    Sub PrintForms()
    Dim db as database
    Dim rs as Recordset
    Dim strPath as String
    Dim strFileName as String
    Dim strMyForm as String
    Dim strFullFileName as String
    Set db = Currentdatabase
    Set rs = db.OpenRecordse t("tblFormNames ")
    Set strPath = "C:\"
    rs.MoveFirst
    Do while not rs.EOF
    strMyForm = rs!FormName
    'I don't know if Forms can be output as RTF but this works with a
    report
    strFullFileName = strPath & rs!FormName & ".RTF
    DoCmd.OutputTo acOutputForm, frmMyForm, acFormatRTF, strFullPath,
    False
    rs.MoveNext
    Loop
    rs = Nothing
    db = Nothing
    End Sub

    That will get your forms printed and into a directory. Emailing them
    depends very much on the local email client but google the group for "send
    Email" and you'll get a variety of solutions.

    Kevin


    <audrey.nsh@gma il.comwrote in message
    news:bbc4316f-7170-4bd2-b280-e331c597b0a5@m4 5g2000hsb.googl egroups.com...
    Hi,
    >
    I have an Access 97 database where the users loads the data (from
    multiple sources) and generates forms (that looks like reports) at a
    click of the button and the user saves the form as .xls and
    distributes to other users via e-mail.
    >
    I need to automate the process of generating the forms, saving the
    report and distributing to other users via e-mail
    >
    Can someone guide me in the right direction?
    >
    Thanks,
    >
    Audrey

    Comment

    Working...