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

display corresponding value textbox value issue

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 3138
ADezii
8,834 Expert 8TB
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
tks MAN! that works great
Feb 2 '07 #3
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
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...
0
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...
2
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...
2
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...
1
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...
3
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...
4
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...
9
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...
2
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...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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...

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.