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

LVL 11
Wilder1626Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.