473,385 Members | 1,983 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,385 software developers and data experts.

Can't change value in combobox

40
Hello,
I have a form with two comboboxes:
ID: [cmbBoxID, Unbound]
Name: [cmbBoxName, ControlSource = Emp_Name]

The problem is that I can't change the value of cmbBoxName, just as if it was locked but it isn't. I also want it to have ControlSource.
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmbBoxID_AfterUpdate()
  2. Set rs = Me.Recordset.Clone
  3.     rs.FindFirst "[Emp_ID] = " & Str(Me![cmbBoxID])
  4.     Me.Bookmark = rs.Bookmark
  5. End Sub
  6.  
The idea is I want to change Emp_Name value for current Emp_ID, but I also want it to display current value depending on which ID is selected in cmbBoxID
Jul 20 '07 #1
1 2556
Lysander
344 Expert 100+
Hello,
I have a form with two comboboxes:
ID: [cmbBoxID, Unbound]
Name: [cmbBoxName, ControlSource = Emp_Name]

The problem is that I can't change the value of cmbBoxName, just as if it was locked but it isn't. I also want it to have ControlSource.
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmbBoxID_AfterUpdate()
  2. Set rs = Me.Recordset.Clone
  3.     rs.FindFirst "[Emp_ID] = " & Str(Me![cmbBoxID])
  4.     Me.Bookmark = rs.Bookmark
  5. End Sub
  6.  
The idea is I want to change Emp_Name value for current Emp_ID, but I also want it to display current value depending on which ID is selected in cmbBoxID
I am not clear what you are trying to do in cmbBoxID_AfterUpdate. Are you trying to display a record in your form or trying to change the rowsource for cmbBoxName?

If the latter, your code should be something like
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmbBoxID_AfterUpdate()
  2. cmbBoxName.rowsource="select Emp_Name from tblSomething Where Emp_ID=" & cmbBoxID
  3.  
Jul 20 '07 #2

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

Similar topics

1
by: Austin | last post by:
.................. self.diskList = self.cB = wxComboBox(self,-1,wxDefaultPosition,wxDefaultSize,self.diskList) .................. The code is executed initially. If i want to update only the...
0
by: metamedia | last post by:
How do I get a datagrid to register a data change from a custom control cell (combobox) I've got a Windows Application with a Windows Form Datagrid that has a custom combobox column. When the user...
1
by: Johan Goris | last post by:
I'd like to change the selected value of a combobox, but it does not work in this way : ComboBox c; c = (ComboBox) ct; // ct is a combobox which is added to a form. c.SelectedValue =...
0
by: Ken Arway | last post by:
Using .Net framework 1.1 I've got a Windows Forms application with a tab control having four tab pages. TabPage4 contains a Combobox and a TextBox, which are bound to the same XML file as a...
2
by: Kevin Hodgson | last post by:
I have a DataBound ComboBox, which has a text value as the Value property, and the UniqueID for that value is bound to the Combobox.Tag property. When a user makes a new selection in the...
1
by: Kevin Hodgson | last post by:
I have a DataBound ComboBox, which has a text value as the Value property, and the UniqueID for that value is bound to the Combobox.Tag property. When a user makes a new selection in the...
0
by: zhuang | last post by:
Hi, Adding combobox to datagrid has been posted many times. I have a datagrid which has multiple combobox columns and normal textbox columns. But how could I change other combo box values at...
19
by: active | last post by:
I'm using a ComboBox to display objects of a class I've defined, say CQQ. Works great except somehow I occasionally set an Item to a String object instead of an object of type CQQ. It looks...
2
by: marius4674 | last post by:
I want to use a combobox to change a checkbox but the combobox take information from a table 1 and checkbox from table 2. How do I specify for the specific Combobox.Value to change the...
1
by: Man4ish | last post by:
Hi, How Eventlistner can be used with rendred combo box. I got one example of combobox in table as follows . /* * Copyright (c) 1995 - 2008 Sun Microsystems, Inc. All rights reserved. * ...
1
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.