to cross a table in alphabetical order 
Author Message
 to cross a table in alphabetical order

Hello,
I have a procedure which is connected to a table in order to check the
doubled blooms and to add a number at the end of the name if it has a
doubled bloom. My problem it is that even if my table is in alphabetical
order, when I use it in my vb it does not hold account of it and my
procedure thus does not function! I give you my procedure and I ask you how
to make so that it crosses my table in command alpha of name first name?!

Thank you very much to take time to help me
Sophie

Private Sub VerificationDoublon()
  Dim Doublon   As String
  Dim i         As Integer
  Dim rcEleve   As New ADODB.Recordset

  rcEleve.ActiveConnection = CurrentProject.Connection
  rcEleve.Open "TestCarSpeciaux", , adOpenKeyset, adLockOptimistic

  rcEleve.MoveFirst
  Nom = Trim(rcEleve!Nom)
  PNom = Trim(rcEleve!PNom)
  Doublon = Nom + PNom
  i = 0
  rcEleve.MoveNext
  While Not rcEleve.EOF
    Nom = Trim(rcEleve!Nom)
    PNom = Trim(rcEleve!PNom)
    If Nom + PNom = Doublon Then
      i = i + 1
      Nom = rcEleve!Nom
      PNom = rcEleve!PNom + i
      rcEleve!Nom = Nom
      rcEleve!PNom = PNom
      rcEleve.MoveNext
    Else
      Doublon = Nom + PNom
      i = 0
    End If
  Wend

  Reponse = MsgBox("termin doublon", vbExclamation, "Vrification termin")

  rcEleve.Close
End Sub



Fri, 02 Apr 2004 23:41:56 GMT  
 to cross a table in alphabetical order
I'm not sure I completely understand your objective, and I
don't think it matters. If your goal is to open that
recordset in alphabetical order then simply dim a string
variable then load the variable with an SQL statement that
ends in "ORDER BY [FirstName]"

Then when opening your recordset open the sql statement
instead of the table.

Here's an example:

Dim strSQL As String

strSQL = "SELECT * FROM [TestCarSpeciaux] ORDER BY
[FirstName]"

rcEleve.Open strSQL, , adOpenKeyset, adLockOptimistic

Hope that helps.
-- John Osmond

Quote:
>-----Original Message-----
>Hello,
>I have a procedure which is connected to a table in order
to check the
>doubled blooms and to add a number at the end of the name
if it has a
>doubled bloom. My problem it is that even if my table is
in alphabetical
>order, when I use it in my vb it does not hold account of
it and my
>procedure thus does not function! I give you my procedure
and I ask you how
>to make so that it crosses my table in command alpha of
name first name?!

>Thank you very much to take time to help me
>Sophie

>Private Sub VerificationDoublon()
>  Dim Doublon   As String
>  Dim i         As Integer
>  Dim rcEleve   As New ADODB.Recordset

>  rcEleve.ActiveConnection = CurrentProject.Connection
>  rcEleve.Open "TestCarSpeciaux", , adOpenKeyset,
adLockOptimistic

>  rcEleve.MoveFirst
>  Nom = Trim(rcEleve!Nom)
>  PNom = Trim(rcEleve!PNom)
>  Doublon = Nom + PNom
>  i = 0
>  rcEleve.MoveNext
>  While Not rcEleve.EOF
>    Nom = Trim(rcEleve!Nom)
>    PNom = Trim(rcEleve!PNom)
>    If Nom + PNom = Doublon Then
>      i = i + 1
>      Nom = rcEleve!Nom
>      PNom = rcEleve!PNom + i
>      rcEleve!Nom = Nom
>      rcEleve!PNom = PNom
>      rcEleve.MoveNext
>    Else
>      Doublon = Nom + PNom
>      i = 0
>    End If
>  Wend

>  Reponse = MsgBox("termin doublon",

vbExclamation, "Vrification termin")

- Show quoted text -

Quote:

>  rcEleve.Close
>End Sub

>.



Sat, 03 Apr 2004 00:01:37 GMT  
 to cross a table in alphabetical order
Hi Sophie,
In order to retreive records
that are in the order you want,
Use a Sql statement with an Order By
clause.

"Select * FRom TestCarSpeciaux Order By FirstName"

HTH
Dan

Quote:

> Hello,
> I have a procedure which is connected to a table in order to check the
> doubled blooms and to add a number at the end of the name if it has a
> doubled bloom. My problem it is that even if my table is in alphabetical
> order, when I use it in my vb it does not hold account of it and my
> procedure thus does not function! I give you my procedure and I ask you how
> to make so that it crosses my table in command alpha of name first name?!

> Thank you very much to take time to help me
> Sophie

> Private Sub VerificationDoublon()
>   Dim Doublon   As String
>   Dim i         As Integer
>   Dim rcEleve   As New ADODB.Recordset

>   rcEleve.ActiveConnection = CurrentProject.Connection
>   rcEleve.Open "TestCarSpeciaux", , adOpenKeyset, adLockOptimistic

>   rcEleve.MoveFirst
>   Nom = Trim(rcEleve!Nom)
>   PNom = Trim(rcEleve!PNom)
>   Doublon = Nom + PNom
>   i = 0
>   rcEleve.MoveNext
>   While Not rcEleve.EOF
>     Nom = Trim(rcEleve!Nom)
>     PNom = Trim(rcEleve!PNom)
>     If Nom + PNom = Doublon Then
>       i = i + 1
>       Nom = rcEleve!Nom
>       PNom = rcEleve!PNom + i
>       rcEleve!Nom = Nom
>       rcEleve!PNom = PNom
>       rcEleve.MoveNext
>     Else
>       Doublon = Nom + PNom
>       i = 0
>     End If
>   Wend

>   Reponse = MsgBox("termin doublon", vbExclamation, "Vrification termin")

>   rcEleve.Close
> End Sub



Sat, 03 Apr 2004 00:26:26 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Printing documents in alphabetical order

2. Print documents in alphabetical order

3. Print documents in alphabetical order

4. Automatic alphabetical order

5. Alphabetical order

6. Help, dir : how to class files by alphabetical order

7. DBCombo to show fields in alphabetical order

8. sorting array values in alphabetical order

9. listbox alphabetical order

10. Alphabetical Order

11. Alphabetical order

12. Sort strings in alphabetical order

 

 
Powered by phpBB® Forum Software