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

when the list box is changed i want the text box to update

I'm new to Access. I am using Access 2003. I have a list box and a text box next to it. when a user clicks on the down arrow key and changes the list box i want the text box next to it to make the change also. right now i have this in the Control Source:
=DLookUp("[CPT]","[tblProcedure]","[Procedure]=forms![contacts]![combo186]")

i don't have anything in Onchange event in the list box properties or Afterupdate event in the text box properties.

what do i need to do exactly to get this to work?

thank you in advance!
Dec 4 '06 #1
2 2109
ADezii
8,834 Expert 8TB
I'm new to Access. I am using Access 2003. I have a list box and a text box next to it. when a user clicks on the down arrow key and changes the list box i want the text box next to it to make the change also. right now i have this in the Control Source:
=DLookUp("[CPT]","[tblProcedure]","[Procedure]=forms![contacts]![combo186]")

i don't have anything in Onchange event in the list box properties or Afterupdate event in the text box properties.

what do i need to do exactly to get this to work?

thank you in advance!
'This sample code snippet should help you. The assumptions are: Listbox Name
'is lstTest, the Text Box name is txtLocation, and you wish to populate the
'Text Box with a Location corresponding to the specific ID generated from the
'Combo Box:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboTest_AfterUpdate()
  2. Me![txtLocation] = DLookup("[StorLocName]", "tblStorLoc", "[StorLocID]=" &  Me![cboTest])
  3. End Sub
Dec 4 '06 #2
NeoPa
32,556 Expert Mod 16PB
Assuming the ComboBox is populated from tblProcedure too (if not just ignore this post) then another way would be to populate the ComboBox with two columns.
One to display and select on ([Procedure]) and the other to return a value ([CPT]).
That way, when someone selects a [Procedure] the value of the ComboBox is automatically set to [CPT].
Dec 4 '06 #3

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

Similar topics

21
by: Boris Ammerlaan | last post by:
This notice is posted about every week. I'll endeavor to use the same subject line so that those of you who have seen it can kill-file the subject; additionally, Supersedes: headers are used to...
1
by: Ian Davies | last post by:
Hello In a php file I have a drop down list with index numbers in whos default value is feed into an sql query that filters records from my database and displays them in an html table. Trouble...
1
by: Johann Blake | last post by:
I have a form with a single textbox control which is bound to a DataRelation in a typed dataset. The textbox displays the name of the product depending on the language selected from a combobox....
2
by: Alpha | last post by:
Hi, I have a window based program. One of the form has several textboxes and a datagrid. The textboxes are bind to the same dataset table as the datagrid and the text changes to reflect different...
3
by: Alpha | last post by:
Hi, I have a window C# application. I update the dataset when user finished entering in a text box. But when I want to update the database when OK is pressed, the...
30
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and...
4
by: Mark Olbert | last post by:
I've written a composite custom control which I would like to have update its design-time display when one of several properties changes at design time. These custom properties are not simply the...
0
by: Chuckk Hubbard | last post by:
I solved this problem. I still don't understand why, but it seems Python was appending a reference to the first element at the end of the list, rather than copying the data. I used something...
11
by: Scott Stark | last post by:
Hello, The code below represents a singly-linked list that accepts any type of object. You can see I'm represting the Data variable a System.Object. How would I update this code to use...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
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,...
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,...

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.