Excell Data From Query
Hi
I am trying to use excell to connect to a ODBC database. It works, but I dont know how to use the data. I want to run the query and then put the results in variables, so I can place them on the sheet where I want. Any Ideas?
Thanks
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Excell And VB Query. Help
I have an excell sheet (invoice.xls)
I run a program to generate some data and after that i need to load the invoice.xls file and run the following query.
sqlstring = "SELECT JoinPlatinumInvoice.Salespkey, JoinPlatinumInvoice.invoicenemonic, " _
& "JoinPlatinumInvoice.invoicenumber, JoinPlatinumInvoice.invoiceyear, " _
& "Sum(round(docamt,2)) AS 'balance', JoinPlatinumInvoice.statusid " _
& "FROM factura.factura.JoinPlatinumInvoice JoinPlatinumInvoice " _
& "GROUP BY JoinPlatinumInvoice.Salespkey, JoinPlatinumInvoice.invoicenemonic," _
& "JoinPlatinumInvoice.invoicenumber, JoinPlatinumInvoice.invoiceyear, " _
& "JoinPlatinumInvoice.statusid ORDER BY JoinPlatinumInvoice.invoicenumber"
Or i need to run the query from the program and pass the output to that file(invoice.xls)
I have not idea. Pls help
MS Access Query To Excell
Is there a way to take an Access Query and have it view automatically to Excel instead of viewing in a table format within Access?
Excell Query Tables
hi, ive got a query table in excell and when i try to chage the command text using code and refresh it. if the new data takes up less cells than the old stuff then it doesnt refresh properly. is there any way round this?
How To Retrieve Ms Excell Data (sheet Name) To Sql Table Using Vb (Data Conversion)
hi
i have problem to retrieve a ms excell data to sql table (i'am using sql 2000) using visual basic.
then another problem is after the conversion process, how to retrieve the certain sql field (example name field) and
make it into shortname (example robert joseph to robert) without adding the last name and update it into sql table.
my limitation for the shortname is 12 character.
plss help me
Excell Data
Hi,
I'm new with VB, i have excel data, im trying to sort the data with highest
percentage and produced the result including the name and few information
which can be lookup together with the sort result. so how
can i do this. i try to do this but i dont know how can i bring others
information Please help me for the jump start.
Thanks
Looping Data To Excell
Ok, here is my issue.. I have posted this before but never got a clear answer... I have about 25 variables that I need to write to excel... all 25 to one row - one row at a time.
I can write single variables to single cells and multiple variables to a single cell… what I cant do is write all 25 variables to 25 cells in a single row.
What I need is a way to write all variables to a row then later add different variables to a new row in the same file… I am completely lost.
I have seen posting on how to loop the search for an available row... but I can not seem to get it work.
Here is what i have so far...
Code:
Dim oExcel As Excel.Application
Dim oWB As Excel.Workbook
Dim oWS As Excel.Worksheet
Set oExcel = New Excel.Application
oExcel.Visible = False
Dim oRng1 As Excel.Range
Set oWB = oExcel.Workbooks.Add
Set oWS = oWB.Worksheets("Sheet1")
oWS.Range("A1").Value = txtDate(1).Text ' <-- one variable to one cell
oWB.SaveAs ("c:
esearch_data.xls")
Cleanup:
Set oWS = Nothing
If Not oWB Is Nothing Then oWB.Close
Set oWB = Nothing
oExcel.Quit
Set oExcel = Nothing
Serial Data To Excell
I have a sensor the sends ascii data to the computer by serial, I need a exe that will read that data and put it into an excell document, and move down a line everytime it gets a new reading, But Im not sure what I need to put into vb6 to accomlish this?
Send Data From Vb To Excell
hi
i want to send some numeric data to excell sheet.
i want to develope a graph depending on that values.
chowdarypavuluri@yahoo.co.in
Thanks & Regards
Readwrite Data To Excell
Hi VB Geniuses,
All i want to do is read data from in an excell sheet by VB programme. I have already wrote the codes but only thing i don`t know is how to get data from Excell.Users will be adding some data into excell and i need to get them by a VB programme. It`s will be like below:
open worksheet in `c:xxxx.xls as input
if the date is today
find the date field`in worksheet and get data
Thanks for any help
Exporting Data To Excell
Hi there ,
How Could I Export the data that has been stored in Access DB using VB 6.0 To Excell Worksheet .
It's Uregent , Please any one who has an idea .
Best Wishes
Mohammed
Sending Data To Excell
Hello
I have a programme that creates a notepad document, how do I send the contents of log.txt
to open in MS Excel. I don't want to see log.txt at all.
thanks in advance
V
Textbox Data Transfer To Excell
Hello! I have a UserForm that I have created for an Excel spreadsheet. In this UserForm, I have a Textbox that is set up to word wrap so that users can enter a long string of information. In order to have it appear properly in Excel, I have merged a large section of cells and set them up to word wrap. The problem I am having is that I can type a ton of info into the UserForm TextBox, but I get the "#Value" error in the Excel field. If I just type a couple of lines of info into the TextBox and submit, it works fine (and will even word wrap once). I have made sure that I am not typing in too much info for the space available in my merged cell. I have also changed the MaxLength property all the way up to 100,000,000 and it doesn't make any difference. I haven't been using VB for very long and I cannot figure this out!!! Please help!!
Thanks,
Brandon
Export Textbox Data To Excell
hello
can someone share with me some code that can take data inputted into various textboxes, and then those textboxes data can be exported to an excel file, or some way to take data in vb and export them to an excel spreadsheet? thank you.
Excell Numerical Data Comparison
I have two columns of numerical data A and B. Number of rows in column A > Number of rows in column B. Sum of numbers in column A = Sum of numbers in column B. So you have a scenario where maybe Sum of 1, 2, or 3 or more cells in Column A = a cell in column B. I am trying to write a program with the most efficient algorithm or code for making this comparison in excel and making these many to one mappings. Please help
Writing Data To Cells In MS Excell
The wierdest thing happened. For some reason I can't put a value in the cells. It may be a result of the Row Insert I do but I don't know. Maybe the code can explain.
Code:
For RowCount = 0 To UBound(aryTasks)
Row = Row + 1
Rows(Row).Select
Selection.Insert Shift:=xlDown
Set aRange = .Cells(Row, DATECOL)
aRange.Value = dt
Set aRange = .Cells(Row, MILEAGECOL)
aRange.Value = miles
Set aRange = .Cells(Row, TASKCOL)
aRange.Value = aryTasks(RowCount)
Next
Set aRange = Nothing
Sure appreciate your help.
Scott
The worst thing about wearing glasses is them being on your face.
Nothing is impossible, it just looks that way.
Need Help Quickly Please!! (putting Data In Excell Sheet)
Code:
'Put data in excell sheet
Dim A As String, B As String, C As String, D As String
ColA = LTrim(RTrim("a")) & LTrim(RTrim(Str(i)))
For i =1 to 50
Sheet.Application.range(A).Value = "66"
Next i
To put something in a spreadsheet you do Sheet.Application.range(ColA).Value = "66"
"ColA" is which square it goes into (ie A5 or B3).
So i set colA to eqal a(i), so thats column a and i up or down. And I have to fill 50 cells in each column (A1 to A50)
Ok now the problem is when I do
Code:
Sheet.Application.range(A).Value = "66"
the i in
Code:
ColA = LTrim(RTrim("a")) & LTrim(RTrim(Str(i)))
doesnt change so it always goes into A1.
If anyone knows how to read data off a random acess file and put it into an excell sheet PLEASE tell me how.
Also if you dont get what im trying to ask tell me.
Right Align Cells Data In Excell Sheet Using Vb
I have an MS-Excell Sheet. It has columns and rows populated with data.
I am looking for vb code so that i open the Excell sheet from the vb s/w and when i press a button, all cell data gets right aligned.
Although it cab be done through Excell s/w options. How i can i do this freom vb code.
Please guide.
Fetching Data From A Web-page Into An Excell Cell
How can I fetch data from a certain web-page into an Excel cell?
Let's say the web page looks like this:
...
Manchester United 12 7 3 2 14:5 25
Bolton Wanderers 12 2 6 4 11:16 12
...
How can I fetch for example Manchester United's number of goals (14) into the Excel cell using e.g. VBA?
Any hints? Solutions?
Exporting Data From Grid Control To Excell
Hello Gurus,
I have a small problem.
I am using a grid control in my vb project. Which has 5 columns and
some rows. Now I would like to insert these values from the grid
into a new microsoft excell sheet from vb by clicking a button.
The columns and rows should come as it is there in the grid.
I would like to have the code for this problem.
Can anybody help me...?
Thank you
Regards
Benny
Get Data Out Of Sequential Text File In VBA (to Import In Excell)
Hey,
A teacher of us gave us this nice assignment. He wants us to automate an excell file. The user should open excell, give up a textfile, VBA should get certain data out of this textfile and import it into excell.
My VBA knowledge is rather limited. So i tried to open the text file with a textbox + a command button and the folowing code
VBA
Dim filename as string
Dim location as string
Dim freechannel as integer
filename = txtbestand.Text
If filename = 0 Then
MsgBox "There was no file selected."
Else
location = app.Path & "filename"
If Dir$(location) = " " Then
MsgBox "The file was not found. Please try again '"
Else
freechannel = FreeFile
Open location For Input As #freechannel
VBA
I get an error that the variable is not defined at app.path. What is wrong ? Is there an easier way to import data out of a sequential text file into vba ? Please explain it easily. I'm also in a bit of a rush, because i have to hand in the assignment on thuesday !
Thanks a lot !
SSTab Query && Data Repeater Query
I have set up a SStab to make data from a system easier to organise. The system retrives the data correctly but does not update it. I am using the propertychanged method on the datarepeater.
Private Sub txtclosedate_Change()
PropertyChanged "closedate"
End Sub
Public Property Get closedate() As Date
closedate = txtclosedate
End Property
Public Property Let closedate(ByVal newclosedate As Date)
txtclosedate = newclosedate
End Property
Is the Tab affecting it if so where can I find a guide to sort this out- the KB is not that helpful.
Thanks
Frank
VB And Excell W/out Having Excell Loaded
Can I use a program that retreives data from an Excel speadsheet on a machine that does not have Excel loaded?
Also, when I went to the references to set "Microsoft Excel 10.0 Object Library", it was not listed. Any ideas as to why it was not listed?
Any help or suggestions would be grealty appreciated.
Updating Data List From Data Environment Query
Hi,
I set all my text boxes to the value of the fields returned by my data environment queries. But i'm struggling to do the same with my data list, I have tried setting the data source/member/field properties but still it doesn't work. I'm also using the refresh and refill commands to ensure its updated.
Any suggestions?
Basically I want the correct option selected to represent the value stored in the database.
Thanks
Comparing Data In A Table To Data In A Query
Any ideas on how to compare a field in a table to a field in a query, and then show only those that match?
So far I've tried using DLookup, but end up bringing back twice the amount of records than I really need.
Code:
DLookUp("[SERVICE_REQUEST_ID]","[openrequests]"," [SERVICE_REQUEST_ID]=" & [Table]![SERVICE_REQUEST_STEP]![SERVICE_REQUEST_ID])
I've also tried a subquery.
Code:
Cat: (SELECT [openrequests].[SERVICE_REQUEST_ID],
FROM [openrequests],
WHERE [openrequests].[SERVICE_REQUEST_ID]=[SERVICE_REQUEST_STEP].[SERVICE_REQUEST_ID])
This would be the second expression in a query I'm building. The first one uses a date expression to filter only the records that meet a certain criteria. Now, I just need to add this second one on, which will filter the data again to match only those within a certain query.
Much thanks in advance for any ideas, or just pointing me in the right direction.
Data Environment With Data Grid And Using Query
Ok, very new at this, and only education I have is with Microsoft books I have read.
So here is what I am trying to do.. I am using Data Environment to connect to my database in ACCESS. I am also using a datagid to view the table. What I wan to do is be able to run a query on the database table and show the results in the datagrid.
I am not sure if I am even making any sense here, but hoping someone will have a answer for me
Thanks
Web Query Data
I am currently pulling data from yahoo finance into excel via a web query, can I access the data as some sort of temporary table rather than havine to insert it ino a cell range and then delete what I do not want?
I am assuming I will declare a new QueryTable, define its connection, run it, and then somehow enumerate the table, but I am turning up sparse information on this, most seems to revolve around just importing it to the sheet as the below code does.
like
Code:
Sub AMD()
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://finance.yahoo.com/q?s=AMD", Destination:=Range("A1"))
.Name = "Get_AMD"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "14"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
returns
Last Trade:21.8
Trade Time:1:00PM ET
Change:Up 0.03 (0.14%)
Prev Close:21.77
Open:21.58
Bid:N/A
Ask:N/A
1y Target Est:26.56
I only want the last trade and change values.
I know this code does not work, but it gives the genral idea of what I am going for. I want to be able to process a list of symbols and put them in specific ranges.
Code:
Sub DoTest()
Test "AMD", Range("A1")
End Sub
Sub Test(Symbol As String, Place As Range)
With TempTable
.Connection = "URL;http://finance.yahoo.com/q?s=" & Symbol
'whatever I have to do with the data here
.Destination = Place
End With
End Sub
I have done this by downloading the page and parsing it in .net, but I want to try my hand at doing some things with it in excel.
Thanks
Query Data In VB
is there any way to re-create the way MS Access shows its query results in VB. ideally have a table with rows and columns.
many thanks
nige
Query To Get The Last Data
Hello
Imagine you have the following table
Year | Month | Var | Value
-------------------------------------------
2000 10 Var1 test1
2000 10 Var2 test2
2000 10 Var3 test3
2000 10 Var4 test4
2000 11 Var2 test5
2000 11 Var4 test6
2000 12 Var2 test7
Who can I make an SQL select to get all the value of the variables with only the last value.
Exemple:
If I want the 12 month of 2000 I have the values for the following variables:
Var1=test1
Var2=test7
Var3=test3
Var4=test6
Data Query
Hi, I need help for data query from 1 spread
sheet to another. I will enter data on 1 spread
sheet but the other spread sheet will also
updated. But the latter spread sheet will be
updated only if 2 of the data fields are the
same as the former spread sheet. Hope to get
some advise on this. Thanks.
Query Website For Data
Hello, In my program I want to look on a certain website. When I push a command button I want it to search the site (http://www.slashdot.org) and add the headlines to a textbox. Is this possible?
Use Data From Access Query In VBA
Hello,
I have a query which contains the actual output I want from a database. But I don't want to present the data in a report, nor do I want to export the query results to a txt-file, I want to define how to write the txt file myself.
The question is: how do I access the query from the VBA code? Which variables do I have to define to retrieve for example the number of records of the query in VBA?
How do I get the value of a certain field of a certain record of the query?
Thanks a lot!
Jochen
Area Data In A Query
Hello,
i'de like to know if it's possible to affect a data area at a variable for a query:
My area DK contains a list of users who are numbers.
Code:
Dim ajout as string
Dim CORT as string
CORT=Sheets("user").select &_
Range("J4:J16").select
'REQUETE
Code:
.sql=Select...From...Where...
And ....
'Conditions for the selection in a combobox
'Sélection of cortal team, a list of numbers is affected to her.
If Combobox9.text<>" " then
Select case combobox9.text
Case "' & Cortal & '",ajout=And id_user in DK
Case ....
End select
End if
.sql=.sql & ajout
Thank you for your answer
Tahbre
External Data Query
I have a working sql select statement to sql server. Code runs fine. My problem is trying to determine when the refresh is complete so I can range name or do further calcs. I have tried the wait command, but do not like waiting when I do not need to. Any help would be greatly appreciated.
Query Data In Workbook
Hello!
I have a workbook, which contains 2 Worksheets with Database like data.
And i Join the two worksheets via a DAO Database connection and insert them into the same Workbook.
It works fine, but i think that it is faulty. eg. Excel needs a long time to close if i run the macro, and sometimes crashes on closing.
The simplified code:
Code:
Sub insertData()
Dim rs As DAO.Recordset
Dim db As DAO.Database
Dim query As String
'open 'database'
Set db = OpenDatabase(ActiveWorkbook.Path & "" & ActiveWorkbook.Name, False, False, "Excel 8.0; HDR=YES; IMEX=1;")
query = "SELECT * FROM [DataA$] AS DA, [DataB$] AS DB WHERE DA.ID_NUMBER = DB.ID_NUMBER"
'query data
Set rs = db.OpenRecordset(query)
'insert data into worksheet
Cells.CopyFromRecordset rs
db.Close
Set rs = Nothing
Set db = Nothing
End Sub
It think the problem is, that i use the open workbook as source for the query, but i can't put the data into another sheet. Is there a workaround?
Thx
Import Data Query
I am using the import data function in excel to import and refresh a text file which is fine, however I want to import multiple text files at the same time i.e. in my folder I have
file1.txt
file2.txt
file3.txt
and so on.
Is it possible to do this by adapting the following code:
[/
Sub ImportMyFiles()
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:file1.txt" _
, Destination:=Range("A1"))
.Name = "file1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub /vb]
SQL Query With Internal Data
Hi, I would to know if it´s possible to perform a SQL query in Excel with internal data and show the results also in Excel.
Thanks in advance
Presenting Data From A Query!!
Hi!!
I have a doubt about presenting data from a Database query.. I want something like Excel... (table) where I can add columns which can process another data (like adding columns, etc)... the thing is that I don't know is which ActiveX object I have to use.
I'll appreciate your response
VB6 Data Report Query
Hi all,
I might just be being dense, but does anyone know how to suppress duplicate data within the detail section of a data report.
Example:
I have a recordset which contains -
CustName, Cust ID, PurchDate, Item1, Item2, Item3, Item4
CustName, Cust ID, PurchDate, Item1, Item2, Item3, Item4
---- " ------
etc, etc....
I need to suppress CustName & ID, so I only have 1 occurance showing.
Any help or suggestions greatly appreciated.
NitrO
Get Data From A Query Using ADODB
Hi, the subject tells all about I have, I make a Query into Access 2000, and I want use this query to obtain data from Visual Basic and ADODB.Recordset, is possible use this query like a Recordset using SQL instructions: "SELECT * FROM <Query> WHER ......"
Thanks !!!
Query On Text Data
Hello everybody, i start in database and i want to do query on a text file, but i don't know how i can do? please help me!!!!!!!!!
I've vb5
here's the textfilei post the zip in attach)
FIELDS:
Code:
Codesico Valeur Fiscalité Gestionnaire/Promoteur Dépositaire Devise Nature Frais_entrée Frais_sortie Frais_gestion Classification_COB CodeISIN Fisc Groupe PEA Durée_Recommandée Date_Création 31/05/2002 VENTE Actif2002 DateCoupon Coupon Class1/2002 REND1 Rend12 Rend36 Vol12 Vol36 Sharp12 Sharp36 PHPB Nationalité G Rend60 Vol60 Sharp60 R36brut R60brut
DATA:
Code:
100 CONVERTIBLE BOND EUROPE PLUS Capitalisation LOUVRE (BANQUE DU) NATEXIS BANQUES POPULAIRES EUR SICAV 4.50 0.00 1.20+indx DIVERSIFIE FR0000001000 C S > 24 mois 01/02/2001 15/05/2002 49.93 52.18 12126 752 / 2071 -0.46 -0.36 3.16 -1.07 50.72 - 49.46 France )
101 CMN TRESORERIE (C) Capitalisation CREDIT MUTUEL DU NORD (CAISSE FEDERALE DE) BNP PARIBAS SECURITIES SERVICES - BPGA EUR SICAV 0.00 0.00 0.40 MONET.ZONE EURO FR0000001018 C S < 3 mois 01/01/1992 02/05/2002 73286.95 73286.95 601555 239 / 715 1.10 3.88 3.76 0.00 0.00 0.00 0.00 73286.95 - 72482.74 France [url]www.e-multifonds.com[/url] 3.58 0.77 -0.16 11.75 19.25
102 CMN TRESORERIE (D) Distri.Annuel. CREDIT MUTUEL DU NORD (CAISSE FEDERALE DE) BNP PARIBAS SECURITIES SERVICES - BPGA EUR SICAV 0.00 0.00 0.40 MONET.ZONE EURO FR0000001026 D S < 3 mois 01/10/1995 02/05/2002 61247.80 61247.80 7881 19/12/2001 2829.23 240 / 715 1.10 3.83 3.63 4.35 3.16 0.18 0.10 61247.8 - 60575.7 France [url]www.e-multifonds.com[/url] 3.36 3.00 -0.12 11.33 17.95
105 EFI PERFORMANCE (D) Distri.Annuel. CREDIT COOPERATIF (CAISSE CENTRALE DE) BANQUE FRANCAISE DE CREDIT COOPERATIF EUR SICAV 0.50 dégr. 0.00 1.196 TTC MONET.ZONE EURO FR0000001059 D S < 3 mois 01/01/1992 15/05/2002 356.11 357.89 77200 12/05/2002 13.77 196 / 715 1.14 3.71 3.69 3.60 2.16 0.19 0.18 369.69 - 356.02 France 3.51 1.73 -0.11 11.51 18.81
106 INDOCAM STRATEGIE 7-10 (D) Distri.Annuel. CREDIT AGRICOLE CREDIT AGRICOLE SA EUR SICAV 1.00 0.00 1.00 OBLIG.ZONE EURO FR0000001067 D S > 36 mois 01/06/1992 16/05/2002 2610.04 2636.14 16797 25/06/2001 201.43 758 / 911 -0.60 4.80 -1.03 8.36 7.52 0.21 -0.58 2647.36 - 2586.72 France 1.12 7.26 -0.36 -3.06 5.74
111 INDOCAM STRATEGIE 7-10 (C) Capitalisation CREDIT AGRICOLE CREDIT AGRICOLE SA EUR SICAV 1.00 0.00 1.00 OBLIG.ZONE EURO FR0000001117 C S > 36 mois 01/01/1992 16/05/2002 5313.88 5367.02 189579 30/06/1993 210.58 757 / 911 -0.60 5.06 2.40 3.46 3.95 0.59 -0.23 5389.85 - 5266.4 France 5.34 4.26 0.38 7.40 29.68
112 AMERIQUE RENDEMENT (C) Capitalisation LCF ROTHSCHILD LA CIE FINANC. E de ROTHSCHILD EUR SICAV 4.50 0.00 1.30 ACT.INTLES FR0000001125 C S > 24 mois 01/01/2001 15/05/2002 107.68 112.53 170805 134 / 934 8.36 3.65 10.44 0.00 108.89 - 97.78 France
Data Report Query
Well this is my problem....
First of all I am not able to increase the height of the detail section to more than 4.5 inches...
To be done:
I want to display a set of values(itz a matrix)...40X12
i want to add 12 text boxes in the detail section...This represents each row....then using a loop 1 to 40...i want to change the values of these text boxes...well i can also use labels...but they are static...i want to append to the data for every iteration of the loop...just like when the text box is bound to a datafield....all the records are displayed one after the other inspite of the fact that we have just 12 textboxes
Data Report From DB Query
I have a query set up in my Access 02 DB..It selects 6 fields from 2 different tables, (CourtDate, CaseNum, Violation & TicketDate from the Citations Table, and Lname & Fname from the Offenders Table). I am trying to create a Data Report that will allow the user to enter a date into a text box, and then the Data Report will display all the fields listed above for that date. The query works in Access. I have a Data Environment linked to the query in the DB. with the fields placed on the Data Report, a form with a textbox to enter the date and a cmdbutton to click that sends the date to the query, and then SHOULD (But doesn't) return all info for that date...Any help would be appreciated. I followed MS example on MSDN but they only do it based on 1 table, not 2 or more. Thanks!
Query Data From Access
I have a linktable in access linking to a dBASE file which contains the following records out of more then 50,000 records:
FILE NAME = SCF016
RECORD NOWORK SQRMWORK
1 WOL120519 1
2 WOL120519 2
i use query in access to query for this data using a simple sql statement and it can display out the 2 record in the datasheet screen.
But the problem was in visual basic program with the same SQL statement, i can only manage to retrieve 1 record count where the sqrmwork = 1. Below is the coding that i use. Did i make any mistake somewhere or Is there any better way to get the correct data out and not affect the data loading speed?
txtWOS="WOL120519"
strsql = " SELECT * FROM SCF016" _
& " WHERE SCF016.NOWORK='" & txtWOS _
& "' AND SCF016.SQRMWORK>0" _
& " ORDER BY SCF016.SQRMWORK"
Set wos_scf016 = olddb.OpenRecordset(strsql, dbOpenSnapshot)
xcount = wos_scf016.RecordCount
|