I really, really need your help! I woul be so thankful to you all if you could please help me out with this:
I have a form on which i have a command button to print report. When i select the record that I want to print on a report, then it prints creates the same report twice. It used to work perfectly alright but I dont know why it prints the same report twice. Awkwardly with some of the records it only prints once.
by the way below is the code behind the command button:
Private Sub cmdInvoiceClient_Click()
Dim strAccountRef As String
Dim strSQL As String
Dim intInvoiceExists As Integer
Dim ReportName As String
Dim rsNewDetails As New Recordset 'Making a recordest of new entry, to update fields with financial figures
'Me.Requery - cant use requery since it's based ona query and sorted by date of order
Me.InvoiceDate = Format(Date, "Medium Date")
If Len(Me.SageInvNumber) > 0 Then intInvoiceExists = 1
' If invoice has already been created for this Booking ID then
' tell the user, otherwise create an invoice for this Booking ID.
If intInvoiceExists = 1 Then
MsgBox ("An invoice has already been raise for this booking")
'Create new record in Invoice table
'The autonumber field Invoice.id becomes the unique Invoice number
strSQL = "INSERT INTO Invoice ( Bookingid ) SELECT " & Me.AccountRef & ";"
temp_SageInvNumber = Generate_Sage_Invoice(Bookingid)