Results 1 to 8 of 8

Thread: combo box question,can you help me

  1. #1
    Join Date
    Oct 2009
    Posts
    5

    combo box question,can you help me

    Dear all;

    I have a task on MS accsess fourm which is doing fourm which contain information about companies like company name,contanct person,telephone,location,fax.

    the company name should be on combo box, once i choose the company name,all the information about the company should be retrived from the table ...how can i do this

    also, if i have more than one contact person with diffrent information how can i organize it on the fourm, i mean how these diffrent information will be displayed to the user.

    hope you can help me ,,,

  2. #2
    Join Date
    Mar 2006
    Location
    Oklahoma City, OK
    Posts
    184
    TIP: sub form.

    I like to link a sub form to the combo box. Once you make a selection in the Combo box, the sub form can display the related data using the Master/Child Linking fields.
    Boyd Trimmell aka HiTech Coach
    Microsoft MVP - Access Expert
    [SIGPIC][/SIGPIC]
    Office Programming 25+ years as a Software Developer specializing in:
    Business Process Management
    Accounting/Inventory Control
    Customer Relations Management (CRM)
    Electronic Data Interchange (EDI)

  3. #3
    Join Date
    Aug 2009
    Posts
    50
    Quote Originally Posted by student123 View Post
    Dear all;

    I have a task on MS accsess fourm which is doing fourm which contain information about companies like company name,contanct person,telephone,location,fax.

    the company name should be on combo box, once i choose the company name,all the information about the company should be retrived from the table ...how can i do this

    also, if i have more than one contact person with diffrent information how can i organize it on the fourm, i mean how these diffrent information will be displayed to the user.

    hope you can help me ,,,

    look at this attachment maybe can help
    Attached Files Attached Files

  4. #4
    Join Date
    Oct 2009
    Posts
    5
    hy brother

    i opened the attaced file , it is similar to what i want but i want to ask ..

    1- when i want to choose something from the database how can i show just 1 item for example just the company name , i dont want all the information to be shown ..

    2- how do you link the value that i choose on the combo box to the data that are displayed on the text filed..

    thank you for helping me

  5. #5
    Join Date
    Aug 2009
    Posts
    50
    Quote Originally Posted by student123 View Post
    hy brother

    i opened the attaced file , it is similar to what i want but i want to ask ..

    1- when i want to choose something from the database how can i show just 1 item for example just the company name , i dont want all the information to be shown ..

    2- how do you link the value that i choose on the combo box to the data that are displayed on the text filed..

    thank you for helping me
    Open design form of the sample i attached and see the VBA Code you ill see how this can be done

  6. #6
    Join Date
    Oct 2009
    Posts
    5
    Quote Originally Posted by FMKA View Post
    Open design form of the sample i attached and see the VBA Code you ill see how this can be done

    Hay brother

    i saw this code in the fourm but i have qestions on it >>


    Private Sub cbo12_AfterUpdate()
    Me.Company = Me.cbo12.[COLOR="orange"]Column(0)[/COLOR]
    Me.Contact = Me.cbo12.Column(1)
    Me.Telephone = Me.cbo12.Column(3)
    Me.location = Me.cbo12.Column(4)



    what does Me refer to and what does the numbers Column(num) refer to

    thank you

  7. #7
    Join Date
    Aug 2009
    Posts
    50
    Quote Originally Posted by student123 View Post
    Hay brother

    i saw this code in the fourm but i have qestions on it >>


    Private Sub cbo12_AfterUpdate()
    Me.Company = Me.cbo12.[COLOR="orange"]Column(0)[/COLOR]
    Me.Contact = Me.cbo12.Column(1)
    Me.Telephone = Me.cbo12.Column(3)
    Me.location = Me.cbo12.Column(4)



    what does Me refer to and what does the numbers Column(num) refer to

    thank you
    Okay brother i will try to explain but you will need VBA code tutorials to understand that. microsft access is a module that works with Jet/Ace and Visual basic . Visual Basic contains syntax Code organized to give a certain result you want in certain operation you need. programming codes are complexes but needs dedication to understand. for instance i need to activate a button to transit to the next record i can use Visual basic Code to activate such action as follow


    Private Sub NextRecord_Click()
    On Error GoTo Err_NextRecord_Click


    DoCmd.GoToRecord , , acNext

    Exit_NextRecord_Click:
    Exit Sub

    Err_NextRecord_Click:
    MsgBox Err.Description
    Resume Exit_NextRecord_Click

    End Sub


    lest us Go back to your question

    Expressive code( Me.) you define where the information you take from the combox table will be directed

    e.g Me.First Name= cbo combo box.Column(1) that is to say you calling the First name Text box data that is in combo Box in collumn one to be directed to First Name Text Box in your form . if you want to see collumn display your combox in form thrue proprerties in
    data in Row Source and click the button at the right hand to display Query builder
    Last edited by FMKA; 10-22-2009 at 11:41 AM.

  8. #8
    Join Date
    Oct 2009
    Posts
    5
    nice explenation

    thank you brother

    i am so glad for your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •