473,320 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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...pleaseplease help
Aug 21 '10 #1
1 1026
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_AfterUpdate()
TextField = ComboBoxName.Column(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
Aug 21 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: sao | last post by:
I am currently using Access 2000. In my table it is the following fields that are set up: 1 - Staff Name 2 - Department This table is already populated with 100+ records (staff along with...
1
by: Clay Reitsma | last post by:
I want to populate a combo box with a list of all of the field names in a database (ie. more than one table). I want the user to be able to select any field name to be used in an on the fly query....
1
by: Jason | last post by:
I have a form that is used for entering and editing site address information. The data in the form is from one table, named Total_Site_Address. There are fields in this table (and controls on...
3
by: EJH | last post by:
I have a Database that has three tables. One of the three is just a table that contains three fields and is filled with reference information. One field is 3-Digit(primary key), the next is...
3
by: Neil Guyette | last post by:
Hello, Everyone, I'm trying to find information on how to populate a combo box using a SqlDataReader. I want to be able to set the value of the combo's value property different then the...
7
by: blazted | last post by:
I am having a problem with populating a combo box from a Access DB, I am calling a stored procedure that executes with one row of values. i want to populate those values into my combo box but right...
3
by: pzh20 | last post by:
I have an unbound form/subform where I populate a combo box on the main form, and using the onchange event, display fields from a table in a datasheet subform. I want to add a new record via the...
3
by: mattandlisa3 | last post by:
Is there a way to populate a combo box with a list of fields from a table or query? My purpose in doing this is to allow a user to select a field to search. Also, does anyone have any advice as...
0
pod
by: pod | last post by:
I am new to OOD and n-tier architecture but I want to start the right way. In Visual Studio, I have created a solution with three projects c/w reference to each other i.e. the Business Logic...
2
by: Susy Fernandez | last post by:
I have a form in MS Access 2007 with a combo box (Combo30) and two text box (ID & EntityType) populating from a combo box. When I select information on combo box both boxes get populated ok. ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.