Auto Fill data in textbox from Combobox selection

Arvin

I'm liv'in the dream ....
Local time
Today, 13:58
Joined
Jul 22, 2008
Messages
192
Hello,

I'm totally nesw at this ... so any help would be appreciated

Basically I have a table that stores all the info I need auto pop.

Table (Employess) > Employee Name, Phone, Email

On the form ... I would like to achieve ...

When you select the employee name, that the Phone and Email textboxes auto pop ...

Now, this is the current code I'm using and it only auto pops the Phone textbox and not the Email textbox...

Private Sub Originator_s_Name_AfterUpdate()
Me.[Originator_s_Telephone] = Me.[Originator_s_Name].Column(1)
Me.[Originator_s_Email] = Me.[Originator_s_Name].Column(2)
End Sub

I get no errors either .... I'm stumped :)

thank you in advance
 
is your column number correct? remember it starts at 0
 
Okay ...when you say column ... do you mean the one in the "employee" table or the query table ?
 
Last edited:
Sorry ...so new at this ... Column count states "1" and bound Column is set to "0"
 
column count is 0? what i mean is, if you have a value in your combo box like so
ID | person name | phone | email |
column(0) column(1) column(2) column(3)
 
Yes you are right ....but when I went into the properties of the cbo it states the column as 1 and when i change it ... it telling me that it must be set between 1 and 255
 
Here you sir .... I hope this is what you want .....
 

Attachments

  • ScreenShot047.jpg
    ScreenShot047.jpg
    25.4 KB · Views: 657
and ... here are screenshots of the table and query ....
 

Attachments

  • Query.jpg
    Query.jpg
    33.2 KB · Views: 541
  • Table.jpg
    Table.jpg
    32.4 KB · Views: 497
if you change it to this

Code:
Private Sub Originator_s_Name_AfterUpdate()
Me.[Originator_s_Telephone] = Me.[Originator_s_Name].Column(1)
Me.[Originator_s_Email] = Me.[Originator_s_Name].Column(3)
End Sub
 
Just did ... and no luck .....same as before .....it only auto pops the Phone textbox and not the Email textbox
 
K, .... here is a screenshot of my SQL statement .....

Honestly ...i'm starting to think that "it" hates the email column :)

Thank you in advance
 

Attachments

  • ScreenShot053.jpg
    ScreenShot053.jpg
    45.6 KB · Views: 451
can you post a sample of your database?
 
Here you go sir .....
 

Attachments

  • DB.jpg
    DB.jpg
    25.5 KB · Views: 498
  • ScreenShot054.jpg
    ScreenShot054.jpg
    53.9 KB · Views: 411
no no. The actual database itself.
Remove all sensitive data from it, compact and repair it then zip file it and post it up here so i can take a look
 
Will do ... in 2 mins ...thank you so much!
 
As requested .... here you go
 

Attachments

Here you go. Dont have the text boxes bound, since you are assigning them with the query. Hope this helps!
 

Attachments

OMG! ...bless you man ! ...wow Thank you Thank you Thank you! ! !
 

Users who are viewing this thread

Back
Top Bottom