Question Creating an Order Form (1 Viewer)

kacey8

Registered User.
Local time
Today, 15:55
Joined
Jun 12, 2014
Messages
180
Hi Guys... I am creating two databases currently (there is a reason it is split)

One will be located at an off site location (ie branches) so we have

Branch A
Branch B
Branch C and so on.

One will be located centrally at HQ.

The databases will be used slightly differently

Database One (Branch)

This database will not actually need to store any of the information, All I want it to do is be able to create an order form with the following information

It will only need to be one of the below boxes per order form

ORDER DATE: (Auto fill calender - Today's Date)
BRANCH: (Combo Box)

Then they will add several lines,

POSTCODE: (Combo Box)
EXPECTED NUMBER: (This box will auto fill based on postcode)
DROP DATE: (Calender)
DEPARTMENT: (COMBO BOX)
LEAFLET TO DROP: (text box to type in)

It would hopefully look like this.



The two buttons would add a new line (to increase the order size) and then create a PDF of the whole order which could be E-mailed across to HQ

I hope this is possible,

The second Database is okay and I have this in hand at present.
 

Minty

AWF VIP
Local time
Today, 15:55
Joined
Jul 26, 2013
Messages
10,371
I'm sure IT is possible - but what bit of IT are you having a problem with?
 

smig

Registered User.
Local time
Today, 17:55
Joined
Nov 25, 2009
Messages
2,209
Not sure the idea of the two db
Is it a FE and BE ?

If you use access 2010 you can easily export the report as PDF.
On prior versoons use Leban's PDF creator
 

kacey8

Registered User.
Local time
Today, 15:55
Joined
Jun 12, 2014
Messages
180
Hi there, sorry I posted in a rush,

The main thing I am having trouble is adding the extra line button, I have no idea where to start from here

The two DB's are because they are being used in two physical locations, the branch location will not have access to the server hosting the HQ copy and have different functions, one is to create an order (ie request this/that per the form above) the second is to log it all and organise it all.


I am writing it in 2010 and the FE is being run in Runtime 2010
 

Pslice

Registered User.
Local time
Today, 07:55
Joined
Jan 26, 2012
Messages
16
These are some code examples from Optic Prime
Here is email using Outlook:
Code:
Public Function EmailOutlook(ByRef email_to, email_subject, close_outlook As Boolean, Optional email_body, Optional email_attachment As String)
Dim outlook_app As Object
Dim outlook_item As Object

On Error GoTo EmailOutlook_Err

    Shell "outlook.exe"
    
    Set outlook_app = CreateObject("Outlook.Application")
    
    Set outlook_item = outlook_app.CreateItem(0)
        
        With outlook_item
                .to = email_to
                .CC = ""
                .BCC = ""
                .Subject = email_subject
                .Body = email_body
                .Attachments.Add (email_attachment)
                .Send
        End With
    
    Set outlook_app = Nothing
    
    Set outlook_item = Nothing
  
    If close_outlook Then
    
        ActiveWindow.Close

    End If


EmailOutlook_Exit:
    Exit Function

EmailOutlook_Err:
    MsgBox Error$
    Resume EmailOutlook_Exit

Here is some code to print a report as a PDF
Code:
Public Sub PDF(ByRef report_name, pdf_path, pdf_name, Optional ID As String)

On Error GoTo PDF_Err

    pdf_name = pdf_name & ".pdf"
    
    If ID > "" Then
    
        DoCmd.OpenReport report_name, acViewPreview, "", "[ID]= " & ID
        
        Else
        
        DoCmd.OpenReport report_name, acViewPreview, ""
    
    End If
    
    DoCmd.OutputTo acOutputReport, "", acFormatPDF, pdf_path & pdf_name, False
    
    DoCmd.Close acReport, report_name

PDF_Exit:
    Exit Sub

PDF_Err:
    MsgBox Error$
    Resume PDF_Exit
    
End Sub
It looks like you might want to use a continuous subform to show each line item. Let me know if this helped at all.
 

smig

Registered User.
Local time
Today, 17:55
Joined
Nov 25, 2009
Messages
2,209
There is no need for a button to add a new line.
A normal continous form bound to a table will always have an empty line to add new records
 

kacey8

Registered User.
Local time
Today, 15:55
Joined
Jun 12, 2014
Messages
180
Thanks, both the posts help so much.

Never used a continous form so I will look into it. Thank you. and the PDF print is great,

I'd love to be able to use the outlook function to send it as an E-mail but a lot of people use OWA (Outlook Web App) so doubt it'll work with that, May include both though.
 

Users who are viewing this thread

Top Bottom