Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > link two tables in one form


Reply
 
Thread Tools Display Modes
  #1  
Old 02-15-2004, 03:52 PM
chaos_09 chaos_09 is offline
Freshman
 
Join Date: Feb 2004
Posts: 45
Default link two tables in one form


OK, I have an EmployeeProfile (empno, empname, etc) and SalaryInformation (empno, payrate, salary, etc) table under Emp.mdb. The thing is, I want to be able to view all the records in these two tables in only one form (textboxes range from employee number to salary deductions). I also want to be able to add, edit, delete using the same form. Oh, and I'm using Data Controls too. Can anybody give me a source code on how I can link these two tables programmatically?
Reply With Quote
  #2  
Old 02-15-2004, 04:33 PM
VBJoe's Avatar
VBJoe VBJoe is offline
Village VB Idiot

* Expert *
 
Join Date: Jan 2003
Location: Idaho
Posts: 1,850
Default

Quote:
Originally Posted by chaos_09
... and I'm using Data Controls too. Can anybody give me a source code on how I can link these two tables programmatically?

Are you wanting to do it programatically or using the Data Control?
Reply With Quote
  #3  
Old 02-16-2004, 12:27 AM
chaos_09 chaos_09 is offline
Freshman
 
Join Date: Feb 2004
Posts: 45
Default

Quote:
Originally Posted by VBJoe
Quote:
Originally Posted by chaos_09
... and I'm using Data Controls too. Can anybody give me a source code on how I can link these two tables programmatically?

Are you wanting to do it programatically or using the Data Control?




Either one, which ever is less complicated I guess.
Reply With Quote
  #4  
Old 02-16-2004, 02:02 AM
TnTBass TnTBass is offline
Newcomer
 
Join Date: Feb 2004
Posts: 7
Default

http://www.1337geek.com/code/vb6/database/ADODB/

This code sample has only one table, but you should be able to link the two, using proper select statements (joins).

Then just use the rs.insert, rs.delete, etc to work for both tables.
__________________
1337Geek.com - Technical Knowledge Base. Safe haven for Geeks of all types.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
disable print preview from xlDialogPrint w_seyller Excel 9 12-11-2003 11:20 AM
DataBase with 4 tables - how do I link tables for search Cameron Smithe Database and Reporting 1 07-20-2003 08:45 AM
MDI Form and dimensions kkonkle Interface and Graphics 6 03-26-2003 09:50 AM
Writing data to two tables using one form nonumber Database and Reporting 7 02-01-2003 04:37 PM
Create a new form similar to an existing form ric General 6 07-17-2001 12:47 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->