Display Data From Multiple Tables
Ive got 4 tables
suppliers products orders (order id's + supplier) product-orders (which product belongs to which order)
I want to be able to display the various orders and the products in them and i want to be able to edit the orders. How would i do this?
Usually I would use a datagrid for something like this. But I couldnt get that to work.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Recalling Data From Multiple Fields In Multiple Tables
I am working on a fairly large project for recording client information into a db which has quite a few fields which are spread out among several tables. The code is already written that saves the data to it's appropriate fields in their appropriate tables.In this particular case, under the front tab of the form is the head person's personal information. On the third tab is information pertaining to the head person's dependents. The code I have written saves the head person's data as well as the data pertaining to that person'd dependents' to a table named [Person]. A few lines lower, those persons' IDs are also entered into an additional table called [Relation], in which are only 2 fields: Relation_Parent_ID and Relation _Child_ID. In another control's code, I recall the data of a given person's ID back into the form from which it was recorded. But how do I code it so that even the children's data is recalled when the parent's data is re-inserted into the form? The code to recall every piece of data that is saved for that person's ID, except for the children's data, is already written and functional. How can I cause the children's data, also, to be recalled when the parent's data is recalled?
Thank you very much for all your help
Happieman
a.k.a. Bill
Edited by - Happieman on 6/11/2005 10:18:40 AM
Display Data From Tables
I am trying to learn how to access data in tables except that I do not want to use the data access object. I would like to learn how to do it with code. All of the VB books that I have (6) only seem to discuss using the control.
For instance, (just for learning purposes), if I have 3 tables and one form. There is an ID number that would be the same for each table. One table has names (and ID number), the other with address, city, State zip and ID number, the other with telephone numbers.
How with code do I display the information on the one form?
Can I open a table? Do I need to use a recordset?
TIA,
Linda
Datagrid To Display Data From Two Tables
Hi,
I am trying to display data from two tables in the one datagrid using an ado data control. The first table is expenses and the second is rates and they are joined by rateid. The trouble is I wasnt to show expenses for just one employee..
Having major difficulty. Any help would be appreciated.
How To Fetch And Display Data From 2 Tables?
I have try problem trying to display data from 2 tables.
Btw, I also have another question is that I would like to capture what the user has clicked from earlier page.It is a submit button. i should capture the submit name rite. But when i clicked on the submit button, it capture the submit name but then it does not display the desired data i want.
If it is not using button to capture what the user has entered in the earlier page, if using normal links, how do i do it???
Display Data From 2 Tables Into 1 Flexgrid
Is this possible? Could someone show me an example of how to display it into a flexgrid. I am assuming I need to use a join on the 2 tables, but how then do I get the data to a flex grid. I am able to display one table in a flexgrid by reading the data into a recordset and then populating the flexgrid, but am not sure about two?
Thanks
Getting Data From Multiple Tables
I have a DB w/ 3 tables in it.
Suppliers
Products
Trans
SupplierID is in both the Suppliers and Products Tables,
Three combo boxes named SupList, MatList and TransList
What I am trying to do is to select a supplier, in turn that will automattically
retreive the Materials for that Supplier and populate the Materials combobox.
Can some one get me in the right direction?
Option Explicit
Private MyConn As ADODB.Connection
Private MyRecSet As ADODB.Recordset
Private Sub Form_Load()
'Hide ID Columns
SupList.Columns(0).Visible = False
MatList.Columns(0).Visible = False
TransList.Columns(0).Visible = False
Set MyConn = New ADODB.Connection
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "DataDelPro.mdb"
MyConn.Open
Set MyRecSet = MyConn.Execute("SELECT * FROM Suppliers")
With MyRecSet
Do Until MyRecSet.EOF
SupList.AddItem MyRecSet.Fields("SupplierID").Value & ";" & UCase$(MyRecSet.Fields("SupplierName").Value)
'Below 2 lines not being used at this time till I get first to work
' MatList.AddItem MyRecSet.Fields("ProductID").Value & ";" & MyRecSet.Fields("ProductName").Value
' TransList.AddItem MyRecSet.Fields("TransID").Value & ";" & MyRecSet.Fields("TransName").Value
.MoveNext
Loop
End With
MyRecSet.Close
Set MyRecSet = Nothing
End Sub
Multiple Tables Data In CR
I have different four tables having records. I want to generate report from these tables via Visual Basic program. But when one table data Complete to print in CR some sataments may print through Parameter passsing from VB. This way four tables data print gradually in one CReport.
Thanx in Advance
Unbound TextBoxes To Display Data From Access Tables
Hi all,
I'm trying to create forms in VB (2005 Express Edition) where after data is entered into a textbox, it checks the database for existing records. If there is an existing record, the other textboxes are to be populated with the data.
I have done this in VBA for Access Forms, but I'm really new to VB.
The following is what I used in VBA. For some reason, i can't seem to use DAO even though I've added the reference in VB.
Can someone please teach me how to change the syntax so that I can code in VB?
Code:
Private Sub cmboWPNO_AfterUpdate()
Dim DAOdb As Database
Dim DAOrs As DAO.Recordset
setDAODb = CurrentDb()
Set DAOrs = DAOdb.OpenRecordset("Select * from tblEEPersonal where WPNO = '" & Me!cmboWPNO.Column(0) & "'")
With DAOrs
Me.txtWPNO = .Fields("WPNO")
Me.txtName = .Fields("Name")
Me.txtEEID = .Fields("EEID")
Me.txtDOB = .Fields("DOB")
Me.optNationality = .Fields("Nationality")
Me.txtPPNO = .Fields("PPNO")
Me.txtPPExp = .Fields("PPExp")
Me.txtAgent = .Fields("Agent")
Me.txtAddHome = .Fields("AddHome")
Me.txtDateLast = .Fields("DateLast")
Me.txtUserLast = .Fields("UserLast")
End With
Me.txtWPNO.Visible = True
Me.txtWPNO.SetFocus
Me.cmboWPNO.Visible = False
Me.cmboWPNO = " "
End Sub
Would appreciate any help. I can't seem to find the full code anywhere
Data Report With Multiple Tables
Good morning!
I have a VB application that loads information into Access tables about patients into a Client table, and then supporting information (such as allergies, prescriptions, contacts) into separate tables. There is generally a one-to-many relationship between my client table and the supporting tables. I've inserted a data report into my application to print the information about the patients along with all the supporting information. My instructions said to use the Data Environment designer as a data source. I can select fields from the Data Environment and move them to my data report from the client table and one supporting table, but when I try to select a field from the third table in the Data Environment, I get the round graphic with the slash and VB wont let me drop it on the report.
Am I asking too much of the Data Environment and data report? If so, how do I proceed in getting this information into a report?
Can I use the Data Report without Data Environment and load the report fields with VB code like a form?
Thanks for your help,
Data Report And Multiple Tables
I have been struggling with the Data Report part of VB6 for awhile now. I do have a data environment and data environment connection with no properties set. I am trying to do everything with code and at run-time. I have a report setup right now with a bunch of headings and data fields that are just typed in. My problem is that I need to pull info from multiple tables in one database and display it in the same report. My other problme is that the tables I am pulling info from have some of the same field names. My last problem is that I can't seem to figure out how to do this. Here is the code I have now that I basically got from MSDN but it does pull info from one table and work.
Code:
Dim CN As ADODB.Connection
Dim RS As ADODB.Recordset
Set CN = New ADODB.Connection
Set RS = New ADODB.Recordset
connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
App.Path & "" & dbName
CN.Open connectionString
Set RS.ActiveConnection = CN
RS.Source = "Select * FROM Drivers"
RS.Open , , adOpenStatic, adLockOptimistic
Set rptRaceAll.DataSource = RS
rptRaceAll.Show
I did think that the table.field method might work somehow but I am not sure where or what. If anybody can help me with this I would be very thankful. Also, if anybody knows of any good resources on the data environment and data reporter and doing things at run-time with them please pass it on. Thanks alot!!
-Scott
Retrieving Data From Multiple Tables
Hai, i am trying to retrieve Stud_id and Fname from SD1. I will select City,Area,Center_id and Batch_id from a combo box in another form and i want to select the data which satisfies these criteria.
SD1:
Stud_id,Fname,City,Area
SD3:
Center_id,Batch_id,Stud_id
Code:
Module1.RecordSet ("Select SD1.Stud_id,SD1.Fname from SD1,SD3 where SD1.City = '" & _
Form2.Combo1.Text &
"' AND SD1.Area = '" & _
Form2.Combo2.Text & _
"' AND SD3.Center_id = '" & _
Form2.Combo3.Text & _
"' AND SD3.Batch_id = '" & _
Form2.Combo4.Text & "' ")
MsgBox rs.RecordCount
The following code displays more records than it satisfies.
Thank you
Adding Data To Multiple Tables (VB)
Does anybody know how to add data to multiple access tables through a vb form. I need to pass the UniqueID from my identification table to all my other related tables in the database, so when my users enter the data into the master table they are also entering the uniqueID into the other tables.
Thanks..
Help......................
How To Retrieve Data From Multiple Tables?
Hello all!
I need to retrieve the name of the jobs existing in sql server agent and at the same time, their respective schedule.
Using the statement "SELECT name AS JobName FROM sysjobs" will retrieve the names of the jobs and using the statement "SELECT freq_type AS JobSchedule FROM sysjobschedules" will retrieve the schedule type of the respective jobs.
But I need to display the job name and the job schedule type together, executing the appropriate sql statement in SQL Query Analyzer. How do I go about using the SELECT statement for 2 different tables?
The "appropriate" SQL, when executed, should produce:
--------------------------------
JobName /JobSchedule/
--------------------------------
Job1 /4 /
Job2 / 64 /
Thanks in advance
Edited by - MMC_Newbie on 10/16/2002 11:07:04 PM
Entering Data Into Multiple Access Tables
Ok here's my problem!
I have two access tables, Machine and Component. They are connected via a one-to-many relationship(A Machine has one or more components). The primary key Machine_id in the machine table is the foreign key in the Components table.
I have a form in vb within which i wish to add one machine and then add mulitple components. I have three text boxes which show the machine details eg(name, purchase date and cost) I then have a datagrid which should be empty and allow components to be added. The proble is : i can save a machine easily but the machine_id needs to be placed into the Component table to aloow records to be added. Can anyone send me on the right track please???
How Do You Create Vb Forms That Take Data From Multiple Db Tables?
Please, please can anybody help me as I am really stuck? I’ve created an SQL Server 7 database and would like to create forms to enter the data. I have managed to create forms using the form wizard for data that is from one table but I do not know how to create forms whereby I use data from multiple tables. The form wizard does not seem to allow you to select specific fields from various tables.
Is there anyway I can create a form “manually” using fields from various tables and with the functionality to navigate, add, delete and refresh the records?
If anyone could help I will be incredibly grateful
Shiatsu
How To Link Data Report With Multiple Tables
I am creating data report. I have a database with 4 tables.
Table 1 : Tree
Fields : Treecode, TreeName, Height, Diameter, Cycle Life
Table 2 : SegmentPlan
Fields : TreeCode,SegmentCode, NumberOfTrees, DatePlanted, ForestOfficerInCharge
Table 3 :Segment
Fields: SegmentCode, SegmentPlan, State
Table 4 : Harvest
Fields :TreeCode, SegmentCode, DateOfHarvest, NumberOfTrees, ForestOfficerInCharger, Comments
When I create the data report I only can link to one of the tables. I want to get all the fields from all the tables in one data report. How do I do that? I ve tried using data environment . I created the 1 parent command and 3 child commands but I can only link to 2 tables(Parent and 1 child)...Is there a way to have all my tables to create 1 data report.
And how to acess data report according to "DATE" whereby user inputs the date.
Concantating Data From Multiple Tables To Create An ID Numer
I want to create a BookID depending on the certain criteria. I have three tables: books, categories and subjects
As an example, I want to have the system automatically create the bookID so that it reads like this: APP05-001
APP stands for Application, which is a column named "code" in the category table.
05 stands for the subject ADO, which is the subjectID in the subject table. It has the category id in it to relate to the category table and
001 stands for the first book in that subject which should be stored in the book table. The book table has the subject ID in it to relate to the subject table.
On the front end when adding a new book I want the system to create the bookID.
How do I make this happen?
[resolved Inserting Data Into Multiple Tables/fields
This may not be what the subject line implies. What I want to do is this... I have a form with a text box. I want to insert the text from that box into ONE table's field (MS ACCESS) and have it go into fields of the same name (related fields) in 4 other tables. How can I accomplish that?
Happieman
a.k.a. Bill
Edited by - Happieman on 5/22/2005 10:35:19 AM
Trouble Finding Duplicate Data Accross Multiple Tables
Hi all,
Im having trouble trying to create a VB query in Access XP to locate duplicate data accross 2 tables, then to allow a user to adjust the incomming data to a new value, (recording the old value in the old pack number location.
eg:
Table 1 Pack No
Table 2 Incomming pack no, Old pack number
if anyone could shed some light on it'd be a huge help
Thanks all
Terry
Display Data In Multiple Windows
How do you display different fields in different forms, while keeping them in 'sync' with each other ? By in 'sync' I mean having both windows 'update' as records are moved through ?
ANY help would be appreciated. Thanks.
Split Data And Display In Multiple Lables
Hi,
at the moment this is how i display my highscore list in a listbox, pictures very boring isnt it.
VB Code:
Case Chr$(251) & Chr$(2) frmhighscore.lsthighscore.AddItem Mid$(SplitMsg(a), 3)
i know how to split the data like below
VB Code:
SplitMsg = Split(Msg, "+")splitmsg(1)
and i dont realy want, JIM THE BUM HAS 1200 POINTS ETC, so if i just send this infomation:
TopTen(i).UName & "+" & TopTen(i).Rank & "+" & TopTen(i).Reputation & Chr$(0)
i could split the data and DISPLAY IT name/rank and reputation points in different labels which would mean each one could have its own unique colour/font/size etc..see what i mean.
can anybody help me to display the data into labels?
Display Multiple Records In Columns Using Data Report
i know how to display records and grouping it but im having trouble creating a report with mutiple records in columns arrange in some like this way
Boys: Girls:
name1 name2
name3 name4
name5
where either the boys column or the girls column would exceed the other
can anyone help me?
Display Data Report Multiple Times?!? << SOLVED >>
Hi guys,
I am doing a ordering system and need to print ouy invoices. I have designed my 2 invoices, one for customers and one for the company, as reports.
When a customer requests a product, if it is instock it is added to their order. Otherwise it is placed in a new order, called preorder.
The invoices are then printed immeadiatly by way of the system operator using the print button on top of the displayed report.
I need, for each order or preorder, a customer invoice and company invoice printed.
I do not want to make copies of the report and then call them as I have no idea how many preorders will occur, it could be 1 or 2, or maybe 1000!!
So what am i looking for . . .
Ideally I want something like a for loop to cycle through the order numbers, loading the report each time with the appropriate data. The catch is that the report needs to stay open until the user either prints it or closes it.
Any ideas would be very much appreciated!
Sorry for the poor explanation, I just hope someone knows what I mean
Cheers
Speed31014
===================================================================
Ok Guys...
Just for future reference the soloution I found for this is...
For i = 1 To 10
DataReport1.Show vbModal
MsgBox (i)
Next
This displays the report then waits for it to be closed before continuing.
Cheers
Speed31014
Edited by - speed31014 on 8/27/2004 2:16:17 AM
How Do I Access Data From Two Separate Ms Access Tables To Display To A Single Form
I'm working with a database which has 3 tables. the first one has the employee info, the second, the deduction and allowances and the third the payperiod info. now what i have to do is display [lastname], [firstname] & [mInitial] - (all found in the employee info table) - and the due payment for loans and total allowances availed (from the deduction and allowances table) to a visual basic form. i made use of this (im not really sure if it's the right code, anyway it doesn't work... everytime i run the project, the form shows up but it displays nothing except the employee information (lastname, FName and MInitial):
...adoPrimaryRS_O.Open "select ( [LName], & chr (32) [FName], & chr(32) [MInitial] as Name from tblEmployee, " & " [Total Deduction], [TotalAllowance] from tblDed_Allow," ...
can anyone help me with this? tnx...
Creating A "Data" Report From Multiple Tables
Hi,
I need to start creating data reports which extract data from over four different tables and produce an invoice as a result.
I've been considering extracting all the neccessary information and then entering this into record in a "invoices" table, while this does duplicate data it would allow for invoices to be reprinted easily.
Is this a bad idea? Would it be better to attempt to write a query using the dataenvironment which extracts from four plus tables?
I like the option of reprinting invoices when neccessary.
Thanks
Importing Multiple Sheets From A Excel Spreadsheet Into Multiple Tables
hello all,
I am trying to code, but i am just stuck after importing one sheet. so here is the gist of what i need help with.
In a workbook at the start of the year (january) i will have 4 sheets and these sheets will keep increasing to 12 when the month is december. so i want is, sheet 1 (named abc) should go into table 1 (named abc), sheet 2 (named def)should go into table 2 (named def), sheet 3 (named xyz) should go into table 3 (named xyz). then sheet 4 through the next sheets till sheet 12 (named balance1, balance2, abalance3...so on till balance12) should all go into one table 'table4' (named balance) and all these sheets should keep appending starting from 1 then 2 all the way to 12.
I am able to put one sheet into one table and below is the code....i need help with the other part of my requirement
Code: ( text )
Dim cn As ADODB.Connection
Dim oRs As New ADODB.Recordset
Dim cnAccess As ADODB.Connection
Dim rsAccess As New ADODB.Recordset
' Open Excel Connection
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=C:Test.xls;" & _
"Extended Properties=Excel 8.0;"
.Open
End With
' Open Access Connection
Set cnAccess = New ADODB.Connection
With cnAccess
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=C:Documents and SettingskrishnamDesktopIntercompany Consolidation.mdb;"
.Open
End With
' Load ADO Recordset with Excel Sheet1Data
oRs.Open "Select * from [abc$]", cn, adOpenStatic
MsgBox oRs.RecordCount
' Load ADO Recordset with Access Data
rsAccess.Open "select * from tbl_abc", cnAccess, adOpenStatic, adLockOptimistic
MsgBox rsAccess.RecordCount
'Synchronize Recordsets and Batch Update
Do While Not (oRs.EOF)
rsAccess.AddNew
For i = 0 To 11 -----11 columns in table 1
rsAccess.Fields(i).Value = oRs.Fields(i).Value
Next
rsAccess.Update
oRs.MoveNext
Loop
End Sub
please help me so that i can move forward...
Multiple .MDF Files With 1 Table OR 1 With Multiple Tables?
In the past, I justed just one .MDB (access) database file with multiple tables, but have run across several commercial programs that have multiple .mdb files with one table. Those tables are then all linked.
Is there reason to go one way or the other and why? If using multiple .mdb files, how do you create the links between the tables in different .mdb files?
--Gary
Updating Multiple Tables With Multiple Recordsets
Hi,
I am trying to update two tables at once, based on the same text box inputs I seem to come close but it will not update the second table. Here is my code:
Option Explicit
Dim Rs As Recordset
Dim Rs2 As Recordset
Dim CN, CN2 As Connection
Private Sub cmdBack_Click()
If Not Rs.BOF Then
Rs.MovePrevious
End If
If Rs.BOF And Rs.RecordCount > 0 Then
Rs.MoveFirst
End If
End Sub
Private Sub cmdNext_Click()
If Not Rs.EOF Then
Rs.MoveNext
End If
End Sub
Private Sub cmdRefresh_Click()
Rs.Requery
End Sub
Private Sub cmdSearch_Click()
Rs.MoveFirst
Rs.Find "LastName = '" & txtSearch & "'"
If Rs.BOF Or Rs.EOF Then
If MsgBox("The record you entered was not found, Do you want enter another name ?", vbQuestion + vbYesNo, "ID Check") = vbYes Then
txtSearch = ""
txtSearch.SetFocus
Exit Sub
Else
Rs.MoveFirst
txtSearch = ""
Exit Sub
End If
Else
'Fills in the data with the fields based on the found data
txtLastName = Rs.Fields("LastName")
txtAmount1 = Rs.Fields("Amount1")
txtAmount2 = Rs.Fields("Amount2")
End If
End Sub
Private Sub Command1_Click()
Dim ST As String
Rs.AddNew ' Add a new record
Rs.Fields("LastName") = txtLastName
Rs.Fields("Amount1") = txtAmount1
Rs.Fields("Amount2") = txtAmount2
Rs.Update
'CurrentDB.Execute ("Update tblName2 Set Last_Name = '" & txtLastName & "',Amounta = '" & txtAmount1 & "',Amountb = '" & txtAmount2 & "'")
Rs2.AddNew ' Add a new record
Rs2.Fields("Last_Name") = txtLastName
Rs2.Fields("Amounta") = txtAmount1
Rs2.Fields("Amountb") = txtAmount2
Rs2.Update
End Sub
Private Sub Form_Load()
Set CN = New ADODB.Connection
CN.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = H:E544293Desktopdb1.mdb;"
Set Rs = New Recordset
Rs.Open "Select LastName, Amount1, Amount2 from tblLastNames", _
CN, adOpenKeyset, adLockOptimistic
Set CN2 = New ADODB.Connection
CN2.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = H:E544293Desktopdb1.mdb;"
Set Rs2 = New Recordset
Rs2.Open "Select Last_Name, Amounta, Amountb from tblName2", _
CN2, adOpenKeyset, adLockOptimistic
Set txtLastName.DataSource = Rs
Set txtAmount1.DataSource = Rs
Set txtAmount2.DataSource = Rs
txtLastName.DataField = "LastName"
txtAmount1.DataField = "Amount1"
txtAmount2.DataField = "Amount2"
End Sub
I think it has to do with the adOpenKeyset, adLockOptimistic at the end of the connection string, but if it is this it will not let me take it out or chage it. I also tryed moving things around and that did not woprk.
If any one has any ideas, of waht I am doing wrong, I would really appreciate it
Thank You
Linking Tables Ala Access Get External Data/Link Tables
Hi,
I have a scenario where I am in a network environment running SQL Server. Normally, we create reports using Access by creating an empty database and then using the Get External Data/Link Tables function to populate it with the SQL data and then manipulate our local database rather than accessing the SQL server directly.
I want to do the same thing using Visual Basic 6. I want to provide the user a blank .mdb file, or just create one during runtime, and then have VB link to the SQL tables automatically without any user intervention. How can I go about doing this?
YaMiYuGi1969
Updating SQL Tables With Data From ORACLE Tables
I am tyring to write a stored procedure which will refresh tables on SQL Server with Data from corresponding Tables in ORACLE. The Oracle database is linked via a Linked Server in SQL. I have witten the following SP:
CREATE PROCEDURE dbo.sp_RefreshDDMSTables
AS
DECLARE @strSQLTable varchar(100)
DECLARE @strDDMSTable varchar(100)
DECLARE @strSQL varchar (100)
DECLARE rs CURSOR FOR
SELECT [Name] FROM dbo.sysobjects WHERE left([name],7)='T44DDMS' AND xType='U'
OPEN rs
FETCH NEXT FROM rs INTO @strSQLTable
WHILE @@FETCH_STATUS = 0
BEGIN
SET @strSQL = 'TRUNCATE TABLE ' + @strSQLTable
SET @strDDMSTable = substring(@strSQLTable,9,len(@strSQLTable)-8)
EXEC (@strSQL)
SET @strSQL = 'Insert Into ' + @strSQLTable + ' SELECT ' + @strSQLTable + '.* From P48..T44DDMS.' + @strDDMSTable
SET ANSI_NULLS ON
SET ANSI_WARNINGS ON
EXEC (@strSQL)
FETCH NEXT FROM rs INTO @strSQLTable
END
CLOSE rs
DEALLOCATE rs
GO
Whe this SP is executed the following message is returned:
Server: Msg 7405, Level 16, State 1, Line 1
Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query.
Can anyone help please?
Thanks
Select And Display From 2 Tables
I have two tables (sales and purchases) in my Access DB that have 4 fields (ID, Date, Amount and Description). Currently I display the contents of each table in a seperate MSFlexGrid, however I want to display the contents of both tables in the one MSFlexGrid sorted by date. Can someone give me some help with some sample code.
Thanks.
Display 2 Tables In One Flexgrid
Is this possible? If so can someone give me an example of how to do it? I can read 1 table in my database and display it in the flexgrid, but am not sure about 2 different tables. I am assuming I will need to use a join?
Listview Display From 2 Or More Tables.
Hello all,
I have a listview with 4 columns, Home, Away, Home score, Away score.
The data for Home & Away come from the table "Teams", the data for Homescore comes from the "HomeTeam" table and the data for Awayscore comes from the "Awayscore" table.
My question is how to set up the query so that the info can be displayed in the listview, respectively. I can get the "Home" team to display in the first column, but I don't know how to get the rest.
The query is also based on the selection of a date from the DTPicker.
I'll add the zip file if anyone wants to take a look at it.
If you don't understand what I'm trying to do, message me please.
Thanx in advance.
Cheers
Edited by - ziggy on 1/21/2003 3:47:10 PM
Display Query Tables
Hi All,
I have succefully connected to database and can display query tables through
dataview window by clicking, but I am having problem to display the tables in
form to the user or is there any way that I can display the table by VB code.
Please reply as soon as possible
Thanks in advance...
Ananthan I
Unable To Display Info From Another Tables
Hi all ...
I had tried to display info from another table in the detail section of the datareport.
But everytime, it will return me error stating "Datafield 'po.itemno' not found."
My coding stated below:
sql = "select pr_info.po_no, pr_info.po_req_date, " & _
"pr_info.po_requestor, pr_info.po_req_dept, " & _
"pr_info.po_req_callcentre, pr_info.po_top, " & _
"item_info.itemno, item_info.itemdesc, item_info.itemqty, " & _
"item_info.itemprice, item_info.itemamt " & _
" from pr_info LEFT outer join item_info on pr_info.po_no = item_info.ItemPONo " & _
"where pr_info.po_no = '" & lblPR_No.Caption & "'"
DataEnvironment1.Commands!Item_Info.CommandText = preshape & sql & _
" order by pr_info.po_no, item_info.itemno} AS pr_info COMPUTE pr_info, " & _
"ANY (pr_info.'po_no') as po_no, " & _
"ANY (pr_info.'po_requestor') as Requestor, " & _
"ANY (pr_info.'po_req_date') as ReqDate, " & _
"ANY (pr_info.'po_req_dept') as ReqDept, " & _
"ANY (pr_info.'po_req_callcentre') as ReqCC, " & _
"ANY (pr_info.'po_top') as TOP " & _
"By 'po_no'"
dataRptPRS.Caption = "Purchase Order for " & txtPR_SupName.Text
If DataEnvironment1.rsItem_Info.State = adStateOpen Then
DataEnvironment1.rsItem_Info.Close
End If
dataRptPRS.Refresh
dataRptPRS.Show
quite urgent.. Would appreciate all the help.
TIA~!
Select And Display From 2 Tables *SOLVED*
I have two tables (sales and purchases) in my Access DB that have 4 fields (ID, Date, Amount and Description). Currently I display the contents of each table in a seperate MSFlexGrid, however I want to display the contents of both tables in the one MSFlexGrid sorted by date. Can someone give me some help with some sample code.
Thanks.
Display A List Of Tables Instead Of Records.
This is a question that I've thought about for a few days now and can't seem to come to a conclusion on my own so I hope that someone can help me out.
I know how to open a single table, display the records in a listview, select a record from the listview to display the corresponding information. What I would like to do is have a list of tables show in the listview and when one is selected, activate it so that I can enter new information.
If you have any ideas or need more info, just post it here or email me:
izaquarius@hotmail.com
I'm sure that I'm not the only one to come up with this kind of situation, any other approaches are welcome also.
Thanx a lot in advance.
Cheers!!
SQL With Multiple Tables...
Hi...I was just wondering...
I have three tables...Agencies, ProductsOrdered, and Orders.
I have 5 listboxes representing 'Monday' to 'Friday'...what I need to do is go into the database and retrieve the Agencies...plop it into these listboxes according to the day the Agencies place and order which is in the ProductsOrdered table. My question is...do I have to go into the ProductsOrdered table, get the OrderID for orders place through Monday to Friday, open up the Orders table, match the OrderID from the ProductsOrdered table to the OrderID from the Orders table, get the AgenyID from this table and open up the Agencies table and finally get the Agency and populate it into the listboxes!!! This is the long way of doing it, can I just SQL with InnerJoin to do all of this? I hope I'd explained this well enough!!!
THANKS!!!
Multiple Tables
What is the syntax for a select statement that searches through multiple tables?
Multiple Tables
Hi guys,
I was wondering, is there anyways to pull out data from 3 tables? if there is how?
Thank you
Multiple Tables
Hello, I have a design problem. What I am doing is creating n-tear application with ASP.NET using VB and using WEB Services.
My web service is responsible for creating connection object to Oracle database, and retrieving information and put it in to dataset. SQL statements is provided by business module class that is calling web service. This information is then displayed in the datagrid. Once changes are made this dataset gets posted to web service for update/insert/delete.
In most of cases these SQL statements will be connecting multiple tables with WHERE a.pk = b.fk etc…
What is the best way to load this data in to data set, so I can use commandObject to automatically post them back to database? Should I load data in to several tables inside of one dataset with separate SELECT statements? What about displaying multiple tables in the datagrid? Parent-child?
Please help me with this design logic, and with some sample code, for this process.
Thanks,
How To Display Related Fields From 2 Access Tables On One VB Form?
Hi, everyone!
I have started learning Visual Basic 6.0 and started creating a user-friendly interface for my home DVD collection database. All seems to be going fine but I am stuck in one place at the moment and it drives me mad : how do I display Genre description on my DVD form that contains DVD details? On the DVD form I have placed two ADO connections: for DVD table and Genre table. I know how to write SQL queries in the code but I cannot manage to have it working! I'd like genre to be shown respectively for each DVD when I navigate between them.
Please, help me! I start dreaming of possible codes at night and it really drives me mad
Thanks in advance!
Multiple Tables Summary
Hi,
Here is my problem. I have an excel file with multiple work sheets. In each work sheet i have a table with the following fields: Name, Surname, ID_number. All that I want is to be able to make a new work sheet in which i can generate automaticly a table which contains all students (Name, Surname) who have an ID_number bigger than 100.
PLEASE HELP ME
Self Join With Multiple Tables
Hi, Ive a working Query...
SELECT dbo.TblLookupPreferences.ContactType, dbo.TblEmailAddress.Email, dbo.TblEmailAddress.Name, dbo.TblEmailAddress.Title,
dbo.TblEmailAddress.DoNotMail, dbo.TblLookupPreferences.AssociatedType
FROM dbo.TblAdmMain INNER JOIN
dbo.TblLookupPreferences ON dbo.TblAdmMain.AdminID = dbo.TblLookupPreferences.AssociatedID INNER JOIN
dbo.TblEmailAddress ON dbo.TblLookupPreferences.LookupValue = dbo.TblEmailAddress.EmailID
WHERE (dbo.TblLookupPreferences.ContactType = '7') AND (dbo.TblEmailAddress.DoNotMail = 'N') AND (dbo.TblLookupPreferences.AssociatedType = 'A')
But Now I want to add another table to the same view..
The Other TableName is 'TblProspectmembers'
In need to join tblprospectmembers [Memno] field =
TblLookupPreferences.AssociatedID
WHERE
TblLookupPreferences.AssociatedType = 'M'
but I cant figure out the exact syntax for this.
any help would be highly appreciated!
(oh im using Sql server 2000 and Access 2000 as a front end)
Getting The Count Of Multiple Tables At Once
Is there any way we can get the total count of multiple tables with one sql statement? Something like this:
Select count(Video_ID) As VideoCount, count(Customer_ID) As CustomerCount from Video, Customer
Obviously this doesn't work, I was wondering if there was any correct way of doing this. I would appreciate any help. Thanks.
|