• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 345
  • Last Modified:

Transfer from form6 to form 2

Hello all,

I have this code where i transfer information from textbox in form 6 to Combobox and textbox in form 1.

Everything is working great, except for 1 detail.

The first combobox: Form2.ComClient.Text, takes the information from Me.ComClient.Text without any issue.

But for Form2.ComNom.text = Me.ComNom.Text, it does not take the name in Me.ComNom.Text.

Both combobox are 2-dropdown list.

And when i select  Form2.ComNom.text it auto populate the name list base on the text in Form2.ComClient.Text :

'Add the employé name
    Dim sSQL3 As String
  Dim oConnect3 As ADODB.Connection
  Set oConnect3 = New ADODB.Connection
  Dim oRST3 As ADODB.Recordset
  Set oRST3 = New ADODB.Recordset


sSQL3 = "SELECT DISTINCT Prénom FROM [Clients] where Nom = '" & ComClient.Text & "'"

oConnect3.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & Form4.base_de_donnee.Text

ComNom.AddItem ""
ComNom.Clear
oRST3.Open sSQL3, oConnect3
ComNom.AddItem ""
Do Until oRST3.EOF
 ComNom.AddItem oRST3("Prénom")
  oRST3.MoveNext
Loop

Open in new window



I guess that is probably why it does not transfer from form 6 to form 2.

Can you please help me?

Thanks again.


This is the code i have when i transfer from both grid.

'Transfert contact to form 2
        Form2.ComClient.Text = Me.ComClient.Text
        Form2.courriel.Text = Me.txtCourriel.Text
        Form2.address.Text = Me.txtAdresse_residentiel.Text
        Form2.province.Text = Me.txtProvince.Text
        Form2.ville.Text = Me.txtVille.Text
        Form2.telephone.Text = Me.txtTelephone.Text
        Form2.code_postal.Text = Me.txtCode_postal.Text
        Form2.cellulaire.Text = Me.txtCellulaire.Text
        Form2.ComNom.text = Me.ComNom.Text
     
        
 Unload Me

Open in new window

0
Wilder1626
Asked:
Wilder1626
  • 2
1 Solution
 
Wilder1626Author Commented:
Oh, i found it

Like this it is working:

'Transfert contact to form 2
        Form2.ComClient.Text = Me.ComClient.Text
        Form2.courriel.Text = Me.txtCourriel.Text
        Form2.address.Text = Me.txtAdresse_residentiel.Text
        Form2.province.Text = Me.txtProvince.Text
        Form2.ville.Text = Me.txtVille.Text
        Form2.telephone.Text = Me.txtTelephone.Text
        Form2.code_postal.Text = Me.txtCode_postal.Text
        Form2.cellulaire.Text = Me.txtCellulaire.Text
        Form2.ComNom.AddItem Form6.ComNom.Text
        Form2.ComNom.Text = Form6.ComNom.Text

Open in new window

0
 
Wilder1626Author Commented:
Hello,

this is a solution on how to transfer the data:

'Transfert contact to form 2
        Form2.ComClient.Text = Me.ComClient.Text
        Form2.courriel.Text = Me.txtCourriel.Text
        Form2.address.Text = Me.txtAdresse_residentiel.Text
        Form2.province.Text = Me.txtProvince.Text
        Form2.ville.Text = Me.txtVille.Text
        Form2.telephone.Text = Me.txtTelephone.Text
        Form2.code_postal.Text = Me.txtCode_postal.Text
        Form2.cellulaire.Text = Me.txtCellulaire.Text
        Form2.ComNom.AddItem Form6.ComNom.Text
        Form2.ComNom.Text = Form6.ComNom.Text
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now