473,466 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Combobox with 2 columns needs to update 2 fields

5 New Member
Hi,

I have a form that updates an issue log. Among the other fields on it, it contains a combobox with 2 columns that I would like to update 2 separate fields in my database.
ComboErrorDesc displays data 2 fields from my Error table; Error Num and Error which is a description of the error

I would like it to update 2 fields in my issues table - Error Type and Problem Short. I can currently get it to update Error Type with the Error Num but I can't get it to put the Error into problem short..I know it's probably not the best programming practice to be storing the error description in 2 different places like this, but I would really like to do it if it is possible!

Thanks again for your help!
Jan 26 '09 #1
3 2710
missinglinq
3,532 Recognized Expert Specialist
Expand|Select|Wrap|Line Numbers
  1. Private Sub ComboErrorDesc_AfterUpdate()
  2.      Me.ErrorType = Me.ComboErrorDesc.Column(0)
  3.      Me.ProblemShort = Me.ComboErrorDesc.Column(1)
  4. End Sub
Welcome to Bytes!

Linq ;0)>
Jan 26 '09 #2
linwork
5 New Member
Thanks for your help linq!

I am able to get my data to save in the proper fields now...but I am having a problem displaying it. I use the same form to view the data but it doesn't populate that combobox when I try to view it.

For example this is my Add Modify Form. I use it to add new data or display the current data so I can modify it and then save it. Everything has been working well until now that I added this combobox! Other combo boxes display the item that I chose but this combo box is just blank. It doesn't even show the Error Number that I selected.

Did I explain this ok? Please let me know if you need more info...basically I just want the item that I chose from the list to be populated when I open the form again for that record.
Jan 27 '09 #3
missinglinq
3,532 Recognized Expert Specialist
Are you saying that when you return to a given record the Error Number you chose from the combobox doesn't show in the combobox? That's because the combobox is not bound to a field in your underlying table. Why would you want it to be? You've already stored the Error Number in the table in the ErrorType field, haven't you? You certainly don't need it stored twice in each record.

But if you just have to have the Error Number show twice on the form, use this code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.     Me.ComboErrorDesc = Me.ErrorType
  3. End Sub
Linq ;0)>
Jan 27 '09 #4

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

Similar topics

3
by: Paul Fairless | last post by:
Customers table - contains Columns: CustID, Surname, Forename, TtlID Titles table - contains Columns: TtlID, Title TtlID is a Foreign Key in the Customers table. I have a Form frmCustomers...
1
by: newbie | last post by:
Hello, I am using a propertygrid to allow users to edit\create objects at runtime, that can update records in a database. There are certain properties (fields) that I wish to display as...
20
by: MadCrazyNewbie | last post by:
Hey group, I keep getting the following error: "An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.data.dll Additional information: There is no row at...
4
by: Rob Kroese | last post by:
I've got a form with a datagrid that displays a list of items, along with several textboxes, comboboxes, etc., that display the details for the selected item. The columns in the datagrid and the...
30
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
1
by: amber | last post by:
I'm having an issue with a combobox that is making no sense to me at all. I have a form with several comboboxes/textboxes. The values in these boxes are based on a datarowview, which is based on...
3
by: DEC | last post by:
I have a VB application that's about 95% done. As usual, it's that last 5% that's got me stymied. The program is a Bill-of-material update program that interfaces with an SAP database. The BOM's...
0
by: piercy | last post by:
Hi, Im tyring to display a dataGridView with comboBoxes on about 5 of the fields. This table is basically permissions to certain parts of my program. In the database i just store a 1 or a 0 (access...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.