Add one Column to a list box

B

Bob Vance

I want to add this column at the end "tblInvoice_ItMdt.GSTOptionsText" which
would make it 6 Columns to the list box!

lstModify.RowSource = "SELECT Format(MIN(dtDate),'dd-mmm-yyyy') AS StartDate
," _
& " Format(MAX(dtDate),'dd-mmm-yyyy') AS EndDate," _
&
"tblInvoice_Itmdt.HorseID,funGetHorse(0,tblInvoice_Itmdt.HorseID,false)," _
& "Sum(tblInvoice_ItMdt.TotalAmount)" _
& " FROM tblInvoice_Itmdt" _
& " GROUP BY tblInvoice_Itmdt.HorseID" _
& " order by funGetHorse(0,tblInvoice_ItMdt.HorseID,true) " _
& ",funGetHorse(0,tblInvoice_ItMdt.HorseID,false);"



lstModify.ColumnCount = 5
lstModify.ColumnWidths = "1.2 in;0;0;5 in;1.5 in"
lstModify.BoundColumn = 2
 
B

boblarson

It seems to be fairly straightforward:

lstModify.RowSource = "SELECT Format(MIN(dtDate),'dd-mmm-yyyy') AS StartDate
," _
& " Format(MAX(dtDate),'dd-mmm-yyyy') AS EndDate," _
&
"tblInvoice_Itmdt.HorseID,funGetHorse(0,tblInvoice_Itmdt.HorseID,false)," _
& "Sum(tblInvoice_ItMdt.TotalAmount)" _
& " FROM tblInvoice_Itmdt" _
& " GROUP BY tblInvoice_Itmdt.HorseID" _
& " order by funGetHorse(0,tblInvoice_ItMdt.HorseID,true) " _
& ",funGetHorse(0,tblInvoice_ItMdt.HorseID,false) " _
& ",tblInvoice_ItMdt.GSTOptionsText;"



lstModify.ColumnCount = 6
lstModify.ColumnWidths = "1.2 in;0;0;5 in;1.5 in;1.5 in"
lstModify.BoundColumn = 2

--
Bob Larson
Access World Forums Administrator

Tutorials at http://www.btabdevelopment.com

__________________________________
 
B

Bob Vance

Thanks Bob no matter how I do it I lose all information in my list box, I
can see the new column I have created but all Columns are empty and there is
a GSTOptionsText in my Table........................Thanks Bob
 
B

Bob Vance

Bob I will show you the whole code see if you can see why I cant add that
extra Column....Regards Bob
Private Sub subModifyIntermediate()
Me.Caption = "Distribute Through Owner.."


lbHodingInvoices.Caption = "Holding Invoices"
lbDistribute.Caption = "Distribute"
Box95.Visible = False
cmdPrintOneInvoice.Visible = False
lblPrintOneInvoice.Visible = False

fraModify.Visible = True
fraInvoices.Visible = False
fraModify.value = 2
lbl6Months1.Visible = False
lbl6Months2.Visible = False
lblCashSale.Visible = False
cmbCashSale.Visible = False
lblLastInvoice.Visible = False
cmbLastInvoice.Visible = False
cmdPrintInvoicesBatch.Visible = False
lblPrint.Visible = False

cmdSendMail.Visible = False
cmdInvoiceAll.Visible = False
Label82.Visible = False
Label64.Visible = False
cmdInvoiceClient.Visible = False
Label65.Visible = False
cmdInvoiceTax.Visible = False
Label66.Visible = False
cmdInvoiceZero.Visible = False
Label67.Visible = False
lblClient.Visible = False
ckbHelp.Visible = False


lblEmail.Visible = False
fraModify.Visible = False
Box190.Visible = False
lbOwnerName.Visible = False
lbInvoiceID.Visible = False
lbInvoiceDate.Visible = False
lbAmount.Visible = False
lbDate.Visible = False
lbHorseName.Visible = False
lbAboutHorse.Visible = False
cmdAdd.Visible = False
cmdShow.Visible = False
cmdPrint.Visible = False
Label46.Visible = False
lblOneInvoice.Visible = True
lbStartDate.Visible = True
lbEndDate.Visible = True
lbHorse.Visible = True
cmdDistribute.Visible = True
lblHolding.Visible = True
lblDisInv.Visible = False
cmdInvoices.Visible = False


lstModify.RowSource = "SELECT Format(MIN(dtDate),'dd-mmm-yyyy') AS StartDate
," _
& " Format(MAX(dtDate),'dd-mmm-yyyy') AS EndDate," _
&
"tblInvoice_Itmdt.HorseID,funGetHorse(0,tblInvoice_Itmdt.HorseID,false)," _
& "Sum(tblInvoice_ItMdt.TotalAmount)" _
& " FROM tblInvoice_Itmdt" _
& " GROUP BY tblInvoice_Itmdt.HorseID" _
& " order by funGetHorse(0,tblInvoice_ItMdt.HorseID,true) " _
& ",funGetHorse(0,tblInvoice_ItMdt.HorseID,false);"



lstModify.ColumnCount = 5
lstModify.ColumnWidths = "1.2 in;0;0;5 in;1.5 in"
lstModify.BoundColumn = 2

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top