populating fields from combo box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deadmanmss
    New Member
    • Aug 2010
    • 1

    populating fields from combo box

    hello, im having major problems with this and was woundering if someone can give me a clear cut answer to this. i searched around and found out what i was doing wrong and hopefully fixed it.

    but anyways basically ive got a table (Service) which has 3 fields serviceid, Service and Price (obviously services are what they are and price is how much).

    Ive created a form (Order) and in that form i got a combo box that selects the services which is fine, but my other field in the form Price, needs to be able to automatically populate the correct price form the service table for the service selected in the ordertype combo box in the order form (hope that makes sense)

    now i know it an After Update command is needed but i cnt for the life of me understand what command to put in, ive tryed a number of commands but to no avail nothing works...pleasep lease help
  • AdamOnAccess
    New Member
    • Aug 2008
    • 99

    #2
    If I understand you properly, then this may help.

    I use the combo box to store and draw additional data. For example, the row source (query) for the combo box might look like this:

    SELECT data1, data2, data3 FROM table1

    The properties of the combo would be...
    ColumnCount = 3
    ColumnWidths = 0";2";0"
    BoundColumn = 1

    Only data2 will appear in the combo box. data1 is typically your key field. You can use data3 for additional data, in your case, price. You reference the info stored in the third column of the combobox like this:

    Combobox_AfterU pdate()
    TextField = ComboBoxName.Co lumn(2)

    The column property of the combo box indexes the columns starting at zero, so the third column is identified as "2".

    Hope this helps.
    Adam

    Comment

    Working...