473,608 Members | 2,565 Online
Bytes | Software Development & Data Engineering Community
+ 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 1011

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

Similar topics

4
38857
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 for the data and Quest's (BTW this a very nice product) 'create like' function. That would work, but it seems a lot of work for something DB2 should know how to do.
2
5892
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 this....if possible plz send me the sample code.. thanking you,
1
1840
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 about 80 records from the Orders table. 80 out of a 1000 records. Now our data entry form shows our customer addresses, but not customer order history. When looking at all of the tables, customer, payments, orders, they still have all of the...
2
2366
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 list. I know how to fill the data in the drop-down list. But i don't know how to pass this control to Com+. Do we need to pass like private FillList(Object e) {
3
3941
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 form in button2 clicked event: textbox1.Text = "Hello";
5
8983
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
2951
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 of whether the main back end tables are in Access/Jet or SQL. I need to make sure the link to this external table is good each time, so I set its connect string appropriately, starting with ";DATABASE=" then the path and table name. The I...
1
2226
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
22996
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 import/export of phpmyadmin) all would be ok
3
3236
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, item, quantity, price, shippedby, shipdate, shipcost), etc.. I wish to "normalize" this without loosing data. MainTable.ID -> NamesTable (NameID, NameType, LName, FName, etc....) -> AddressTable (AddressID, Type, Line1, Line2,...
0
8057
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
8491
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...
0
8329
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...
0
6813
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5475
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
3959
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4022
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2472
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 we have to send another system
0
1327
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.