Question : Access format Code

1:
Option Compare Database

Private Sub Command0_Click()
Dim strFile As String
strFile = "F:\VarianceOutput.xls"
'DoCmd.OutputTo acOutputForm, Me.Variance, acFormatXLS, strFile, False
DoCmd.OutputTo acOutputTable, "Variance", acFormatXLS, strFile, False

Dim oXL As Object
Dim oWB As Object
Dim oWS As Object
Dim FormulaRow As Long
 
Set oXL = CreateObject("Excel.Application")
Set oWB = oXL.Workbooks.Open(strFile)
Set oWS = oWB.Sheets(1)
With oWS
    FormulaRow = .Cells(.Rows.Count, "d").End(-4162).Row + 2 'xlUp
    .Cells.Font.Size = 10
    .Rows(1).Font.Bold = True
    .UsedRange.EntireColumn.AutoFit
End With
oXL.Visible = True

Set oWS = Nothing
Set oWB = Nothing
Set oXL = Nothing
End Sub

---------------

In the above code, i would like to Stuipulate on output that Columns H, I & J are formatted as percentages and if a negative percentage, in red.

Can anyone help?

Thanks,
Seamus

Answer : Access format Code

you cannot do like that indeed ...
http://www.experts-exchange.com/articles/Database/Miscellaneous/UPDATES-with-JOIN-for-everybody.html
mysql is unfortunately a bit limited in that regards, but you shall check out this:
1:
2:
3:
4:
5:
6:
7:
8:
9:
Update inv i
SET i.total = ( select SUM(v.quantity * s.charges)
          from invitem v
          JOIN service s
             ON s.idservice = v.idservice
          WHERE v.datetime = i.datetime
            AND v.invoiceid = i.id  --- < I presume this link condition is missing also ...
       )
WHERE i.datetime = @uniquekey
Random Solutions  
 
programming4us programming4us