473,480 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Filling textbox from table for the corresponding combobox data - Reg

4 New Member
Dear All,
Say for example, I have a Table named 'Table1' contains fields, ID (as primary), MDate, PersonName, PersonJob. Another table named 'Table2' contains ID (as primary), MDate, PersonName, PersonAddress.
I have a Form contains a ComboBox named 'cmbbox1' and have TextBoxes named 'txtbox1' and 'txtbox2'. I have managed to fill the 'MDate' field values from 'Table1'. I want to fill the selected 'MDate' corresponding value of PersonJob from Table1 in txtbox1 and PersonAddress from Table2 in txtbox2.
Please advice how can I modify the following code.
Thanks in advance.
Regards,
manthiralaya
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmbbox1_AfterUpdate()
  2. Dim DBS As Database, RST As DAO.Recordset, STRSQL As String, Table1 As TableDef
  3. Set DBS = CurrentDb
  4. STRSQL = "MDate=" & cmbbox1 & ""
  5. Set RST = DBS.OpenRecordset("Table1", dbOpenDynaset)
  6. RST.FindFirst STRSQL
  7. txtbox1 = RST!PersonJob
  8. Set RST = Nothing
  9. End Sub
  10.  
Oct 24 '10 #1
0 1005

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

Similar topics

4
38826
by: Robert Stearns | last post by:
For testing purposes I propose to add a schema (testing, how original) and would like to copy some of my live tables to it, both structure and data. I know I could use something like dump/restore...
2
5881
by: narasingarao | last post by:
Hi to group, I'm a student of M.C.A. from B.I.T. Ranchi...I'm in my project period here i have to migrate the MS-Access database table to Oracle data base tables...so, please help me in getting...
1
1822
by: KC | last post by:
Hello, I am using Access 2002. WinXP, Template from MS called Orders Mgmt DB. I have tweaked this DB to work for our small co. It has worked pretty well up until I made the mistake of deleting...
2
2359
by: ramesh | last post by:
hi, I am using Com+ in my application. It will have InsertRecords,selectRecords,updateRecords function. In the Web Form i have Drop-down list. I want to select records from SQL and add it to this...
3
3930
by: Omar Llanos | last post by:
I have Form1 and Form2 (which is inherited from Form1), and I created a button in Form2 that will fill up a textbox in Form1. What code would do that? I tried the simplest way: //from child...
5
8971
by: Quan Nguyen | last post by:
How can I obtain the textbox (editing field) control of the combobox? I tried combobox.Controls to obtain the collection of controls that the combobox contains but it turned out to be empty. Thanks.
1
2941
by: AudreyCole | last post by:
Hi. I have an Access front end .mdb file which in connected to Access tables in some locations and to SQL Server tables in others. It also is connected to an Access table for other data, regardless...
1
2220
by: =?Utf-8?B?RmxvcmlhbiBLb3dhbHNreQ==?= | last post by:
I need to paint a rectangle in above the textbox of a combobox. How can i do that. At present the rectangle is always in the background and the textbox is in the foreground!! Thanks
16
22982
mikek12004
by: mikek12004 | last post by:
How to copy a table (with the data) from one server to another (the two servers are in different PCs)? Basically if I could move the data to a txt file inthe form of the insert command (like the...
3
3228
by: FKlusmann | last post by:
I have inherited a big, messy table with duplicated data and empty fields consisting of Names (business, client, supplier, etc.), Addresses ( physical, mailing, shipping, billing), Orders ( Date,...
0
7055
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
6920
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
7060
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
6760
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
5365
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
4501
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
1311
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 ...
1
572
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.