[AccessD] Help with Mah Arithmetic

Stuart McLachlan stuart at lexacorp.com.pg
Wed Jun 11 18:12:00 CDT 2003


Sorry, won't work. You still need to work from row 0 of 
ItemsSelected. It's the values in the ItemsSelected collection that 
are changed by ColumnHeads - not the index.


On 11 Jun 2003 at 15:51, Charlotte Foust wrote:

> Try this:
> 
> 
> For intPhysicalRow = Abs(.ColumnHeads) To .ItemsSelected.Count - 1
> 
> When columnheads are turned on, they're in row zero, so you want to
> start with row 1.
> 
> Charlotte Foust
> 
> -----Original Message-----
> From: Arthur Fuller [mailto:artful at rogers.com] 
> Sent: Wednesday, June 11, 2003 2:17 PM
> To: AccessD
> Subject: [AccessD] Help with Mah Arithmetic
> 
> 
> I've been staring at the following code and toying with this and that
> and now I'm so punchy I really need a fresh set of eyes.
> 
> Scenario:
> 
> - a listbox with extended select, pk in column(0)
> - a proc that works, called from the loop presented below
> - said listbox has headings ON
> 
> <code>
> '-----------------------------------------------------------------------
> ----
> ------------
> ' Procedure : Send_Text_Confirmations
> ' DateTime  : 6/11/2003 14:50
> ' Author    : Arthur Fuller
> ' Purpose   : Send confirmations not using Snapshot files, send
> generated
> text instead
> '           : This code sends text email messages constaining the same
> data
> as the snapshot
> '           : We use the report's data source directly to retrieve the
> information we need.
> '-----------------------------------------------------------------------
> ----
> ------------
> '
> Private Sub Send_Text_Confirmations()
>   Dim ctl As Control
>   Dim intPhysicalRow As Integer, intCurrentRow As Integer
>   Dim strWhere As String
>   Dim strReportName As String
>   Dim lng_PK_Of_Interest As Long
>   
>   With Me
>     Set ctl = .Item_Selector_listbox
>     With ctl
>     'column headings seem to screw this code up but I can't figure out
> how
>     'to account for them
>       For intPhysicalRow = 0 To .ItemsSelected.Count - 1
>         intCurrentRow = ctl.ItemsSelected(intPhysicalRow)
>         If intPhysicalRow > 0 Then
>           lng_PK_Of_Interest = ctl.Column(0, intCurrentRow)
>           Debug.Print "Creating mail for Practicum Placement #: " &
> lng_PK_Of_Interest
>           Send_Text_PMail lng_PK_Of_Interest
>         End If
>         Next intPhysicalRow
>     End With
>     MsgBox "Emails sent for " & ctl.ItemsSelected.Count & " Practica",
> vbInformation, "Task Complete"
>   End With
> 
>   On Error GoTo 0
>   Exit Sub
> 
> Send_Text_Confirmations_Error:
> 
>   MsgBox "Error " & Err.Number & vbCrLf & _
>            Err.Description & vbCrLf & _
>            "in procedure Send_Text_Confirmations of VBA Document
> Form_frm_Practica_Email_Select", _
>            vbCritical, _
>            "Program Error"
> End Sub
> </code
> 
> 
> The line 
> 	Send_Text_PMail lng_PK_Of_Interest
> 
> Works and is not of interest. Just assume that whatever it does, it
> works. The problem is in the arithmetic and I cannot see it. 
> 
> Well, ok, I'm old, and entitled to more senior moments than you :-)
> 
> Symptoms:
> Select 3 items. It does 2. Select 1. It does none. Select All and it
> works. Headings off and on affect the results. I want the code to
> interrogate HeadingsOn but can't seem to find the attribute.
> 
> Revisions invited!
> 
> Arthur
> 
> 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com


-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System Support.





More information about the AccessD mailing list