473,809 Members | 2,687 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

display corresponding value textbox value issue

46 New Member
Hi community experts,

May I knw whether is it possible to display the corresponding value of the second textbox based on the user input in the first textbox? This means that once the user enters the value of first textbox - S1, the corresponding matching value based on first textbox will be displayed in the second textbox automatically.

I have tried using the AfterUpdate() event of textbox1 control to trigger this scenario but doesnt seem to be working. Perhaps that is not the correct event for this scenario.

Alternatively, I have also thinking of using two contols for this scenario, textbox and combo box respectively. Textbox will accept user input and combo box will populate or filter the result (corresponding value) based on the first textbox. Hence, nt too sure as to how that can be achieved. Hence, any advice, direction or code snippets are very much appreciated!

Scenario

Student table
StudentId S1 S2 S3
Name Peter Shaun Alfred

Student table view
StudentId - datatype(text), primary key
Name - datatype(text)

Form design

Student profile

StudentId - unbounded textbox1
Name - unbounded textbox2

or

StudentId - unbounded textbox1
Name - unbounded combo box1
Feb 2 '07 #1
3 3156
ADezii
8,834 Recognized Expert Expert
Hi community experts,

May I knw whether is it possible to display the corresponding value of the second textbox based on the user input in the first textbox? This means that once the user enters the value of first textbox - S1, the corresponding matching value based on first textbox will be displayed in the second textbox automatically.

I have tried using the AfterUpdate() event of textbox1 control to trigger this scenario but doesnt seem to be working. Perhaps that is not the correct event for this scenario.

Alternatively, I have also thinking of using two contols for this scenario, textbox and combo box respectively. Textbox will accept user input and combo box will populate or filter the result (corresponding value) based on the first textbox. Hence, nt too sure as to how that can be achieved. Hence, any advice, direction or code snippets are very much appreciated!

Scenario

Student table
StudentId S1 S2 S3
Name Peter Shaun Alfred

Student table view
StudentId - datatype(text), primary key
Name - datatype(text)

Form design

Student profile

StudentId - unbounded textbox1
Name - unbounded textbox2

or

StudentId - unbounded textbox1
Name - unbounded combo box1
Expand|Select|Wrap|Line Numbers
  1. Private Sub TextBox1_AfterUpdate()
  2.   Me![TextBox2] = DLookup("[Name]", "tblStudent", "[StudentID]='" & Me![TextBox1] & "'")
  3. End Sub
Feb 2 '07 #2
technocraze
46 New Member
tks MAN! that works great
Feb 2 '07 #3
technocraze
46 New Member
Hi AdeZii & community experts,

I would like to knw whether is it possible to reset (empty) the fields at the form load event without affecting the values of the fields? Because StudentId is my primary key, if i rest the field at form load event, the table values got erase automatically. I want to achieve in such a way, whereby, the resetting of fields at form load wont cause any impact of the data in the table.

Another issue that I would like to seek your consultant is to lock the data of the table so that user cannnot edit the values in it. Tks! (insert, update) from form is still allowed jux that dnt allows user to edit the existing records in the table.

Private Sub Form_Load()
StudentId.Value = ""
Name.Value = ""
Feb 2 '07 #4

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

Similar topics

0
1412
by: tomasio | last post by:
dear group, i made a template with css at http://tomasio.laudatio.com/jobs/Claudia/Cb_template.html. the according stylesheet is to be found at http://tomasio.laudatio.com/jobs/Claudia/stylesheet.css but it differs in two instances from the original screendesign which can be compared with the website at
0
1002
by: Steve | last post by:
I have a combo box which contains a list of JobStatus's which are paired, "Description" (a string to display) and "StatID" (an Int to store). These come from my JobStatus table. I have a screen for updating Jobs, on it I want to have a combo box to represent the Job.JobStatus field, which will reposition the Combo Box to display the corresponding Status that is assigned to that Job, and then of course the user can pick a new status from...
2
4894
by: MJ | last post by:
Hi, I'm hoping this is relatively easy. I have a report based on a query - when you run the report, a form opens up and you are prompted for a date range. These are combo boxes (ie. January 2003, February 2003, etc). The combo boxes display the date field but the field that is actually sent back to the query is the corresponding identifier (ie. 1 for January 2003, 2 for February 2003) etc.
2
1894
by: indhu | last post by:
hi, i have a list box in my form, when i click listbox field it should display corresponding value to other textbox fields. like listbox, these are the corresponding text flds person by clicking this it should display other field values
1
2296
by: Benny Ng | last post by:
Dear All, Now I met one problem in the development of my one application. I have one ASP.NET page. It's for disply the information of customer. But now I have one new requirement. It's to combine the "Edit" and "Display" funtions into this page. (It means if user want to edit the customer information, this page would provided editing page to the user; If the user want to display the customer information, this page would providev the...
3
10822
by: remya1000 | last post by:
i'm using ASP with MSAccess as database. i have two buttons and two textbox in my page. when i press my first button (First month) i need to display the current month in one textbox and last one months date in another textbox. and while pressing the second button (submit) i need to display the date displayed in the textbox as itself and the records between thoses two dates. if that date is still there in the textbox only i can sort the...
4
2439
by: rn5a | last post by:
A MS-Access DB has 3 tables - Teacher, Class & TeacherClass. The Teacher table has 2 columns - TeacherID & TeacherName (TeacherID being the primary key). The Class table too has 2 columns - ClassID & ClassName (ClassID being the primary key) The TeacherClass table has 3 columns - TCID (AutoNumber), TeacherID & ClassID. One teacher can teach multiple classes & one class can be taught by multiple teachers. The TeacherClass table basically...
9
4127
by: tshad | last post by:
I have a Windows App that is doing some work and then writing a "Now Processing..." line to the status line of the window as well as the Textbox on the form. But the problem is that the work is in another class from the main class. So it couldn't access the Status Line or textbox. So what we did was set them up as properties: string IStatusDisplay.Status
2
3689
by: kurtzky | last post by:
i created a form that should function as follows: i will enter a number in a textbox..then it should query from the database all the records which has that number..these records will have a different item no in it..then, these records will be saved in a temporary datatable (which i made in a separate class, the name is WBASKET)...The item nos of these records will be displayed in a combobox, say item1, item2, etc.. then,i have a datagrid...
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9602
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
10639
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...
1
10383
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,...
0
10120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7661
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
6881
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
5688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.