473,657 Members | 2,921 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updating a field from a combo box lookup

I need to provide a pick list for a data entry field. I do everything but
take the selected value and get it into the dataset for eventual update to
the the database. I can show the field of the dataset and I have a separate
combo box field but can't seem to connect the two. Maybe I'm going about
this in the wrong way but any help will be greatly appreciated.
Jun 27 '08 #1
2 1255
On May 22, 1:53 am, "Vinnie the Rat" <asdf@asdfwrote :
I need to provide a pick list for a data entry field. I do everything but
take the selected value and get it into the dataset for eventual update to
the the database. I can show the field of the dataset and I have a separate
combo box field but can't seem to connect the two. Maybe I'm going about
this in the wrong way but any help will be greatly appreciated.
Sorry - I genuinely tried to understand your question, but can't
follow;
Please try to be less succinct - i.e. give us some more information
about what you are trying to do, maybe with a small code example if
appropriate?
Jun 27 '08 #2
Edited the procedure below...

//pc-one

"//pc-one" <no****@notvali d.comwrote in message
news:Or******** ******@TK2MSFTN GP02.phx.gbl...
Hi Vinnie,

I am just learning C# using VS 2008 Express, and am building a small
database project to "get my hands dirty", so my advice may not be the
best considering my experience!

One way to solve your problem: (I did something similar in my own
program, and it works perfectly)
1: table UserTable with a column "color" (the field you wish to
change)
2: table ColorsTable with records of all interesting colors, column is
"aColor"

Define column "color" in UserTable as DataGridViewCom boBoxColumn
*************** **** Edited section
add a foreign key relation between UserTable and ColorsTable : from
"color" to "aColor" (in the dataset designer)
*************** ***
>
When you view the table UserTable in a datagrid or individual
controls, the combobox "color" should be filled with all available
colors from table ColorsTable.

The above is one way to avoid having a separate combobox to select
color.
Less clutter and easier on the user...

Hope I have provided a correct possible solution!

regards

//pc-one
"Vinnie the Rat" <asdf@asdfwro te in message
news:uF******** ******@TK2MSFTN GP05.phx.gbl...
<snipped>

Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3235
by: Marco Simone | last post by:
Hi, What is your opinion about using Lookup field in table. I would like to use lookup field in table 1, so that I can choose data in combo box from table 2. Is this good design of database? Thanks in advance, Marco
15
2649
by: Colin | last post by:
I have a query that calculates the selling price of products on customer orders. Selling prices are calculated based on the average cost of the items when purchased. As I make new purchases, the product cost changes (as it should) to reflect the new average cost. However, the problem is that the selling price of previously sold items also change when new purchases are made. Keep in mind that I'm not storing any calculated values anywhere....
6
6162
by: cyoung311 | last post by:
I'm trying to do an automatic update of one table from another through a form. Basically, when a selection is made for an item, in this case a particular workshop, I want to get the associated price of that workshop from the Workshop table and update my ScheduleDetails table. The tables are as follows: tblStudent StudentID LastName FirstName
1
3353
by: Zachary Turner | last post by:
I want to make a Lookup Field based on another Lookup field. In other words, I have this table A with two fields: ID and Name, where ID is an Autonumber and Name is a friendly name. Then I have a table B which links to A via a Lookup Field so that I can select the friendly name from combo box. Now, I want to have a table C which links to table B via a lookup field, and only displays the items which are selected in some combo box of some...
7
8521
by: Donald Grove | last post by:
Is it possible to retrieve field properties from a table in access2000 using code? I have tried: " dim dbs as dao.database dim tbl as dao.tabledef dim fld as dao.field dim prop as dao.property
3
1766
by: silvastein | last post by:
It would be great if someone can help me with this. It seems like it should either be easy (so far, not!) or maybe it isn't possible. Here goes: Table B has TextField1 that looks up values from a single field in Table A. When I create a form for filling in Table B, TextField1 appears as a long list of options from Table A. If I were to make the field really tall, it would show multiple rows of data from Table A. I would prefer...
2
7978
by: Greg Strong | last post by:
Hello All, Is it possible to change table field lookup properties in code? I've been able to change other field properties in code, however so far no luck with field lookup properties. What I've done for test purposes is use a text input file for the table field lookup properties. I thought that I'd start first by just changing the 'Display Control' property. Thanks to Allen Browne for some ideals per...
3
4200
by: SteveM | last post by:
I have a locked field on a tabular form that maps to a lookup table. However, since the field is view only, I'd like to remove the lookup dropdown arrow. Any ideas. Thanks, SteveM
2
2898
by: King Ron | last post by:
Ola all. In responding to a recent post requesting help with a search issue, I recommended using a combo box lookup in the table design. "paii, Ron" (no relation) posted this reply: " There are many posts in this group explaining the pitfalls of using the lookup feature in tables. Best practice appears to be, keep the lookup in the forms using combo box or list box."
0
8302
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8820
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8718
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8499
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5630
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.