Display Records In Datagrid
hi all,
i want to type some name in my textbox. when i start type something ( i feel in textchange itselft) the datagrid should fill with those records from the table starting with letter i typed in the text box. how can i go about. which grid control is best suit here. i need some suggestions. and the beginning code if possible.
another query is can i able to display the records of two tables in a grid
thanx in advance saj
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Display Records In Datagrid And Others
HI
I want to be displayed records in datagrid. i tried it using given code but it gives error like "rowset in not bookmarkable"
rs3.Open "select * from billauto", cn, adOpenDynamic, adLockBatchOptimistic
Set DataGrid1.DataSource = rs3 ' here it gives error
datagrid1.refresh
and i want to update,delete addnew records directly from datagrid
Please help me
waiting for reply
Thanx a lot
Display Records In Datagrid And Others
HI
I want to be displayed records in datagrid. i tried it using given code but it gives error like "rowset in not bookmarkable"
rs3.Open "select * from billauto", cn, adOpenDynamic, adLockBatchOptimistic
Set DataGrid1.DataSource = rs3 ' here it gives error
datagrid1.refresh
and i want to update,delete addnew records directly from datagrid
Please help me
waiting for reply
Thanx a lot
How Do I Use Datagrid To Display My Records In The Access DB
hi, how do i display all my record in the Access DB using a Datagrid...can anyone help me with the codes
this is my coding:
Dim SQL As String
Dim cmbRS As ADODB.Recordset
Dim Cnn As ADODB.Connection
Dim RS As ADODB.Recordset
Dim sqlstr As String
sqlstr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & App.Path & "" & DataEnteries.DBname.Text
Set Cnn = New ADODB.Connection
Cnn.Open sqlstr
SQL = "SELECT * FROM " & month.Text & ""
Set RS = New ADODB.Recordset
RS.Open SQL, Cnn, adOpenDynamic, adLockOptimistic
Set DataGrid1.DataSource = RS
got error: the rowset is not bookmarkable
Ah Xing
Display Records Into A Datagrid Or FlexGrid
Hello everybody,
I have a MS Access database and i want to see some entries from a table into a datagrid or FlexGrid from a form.
The records are not the same everytime because they depend from a SQL statement wich gets 2 variables.
When i use the datamember and datasource from the properties window i can`t see anything, but if i use an SQL statement wich doesn`t get any variables i can see the records just fine,
Does anybody knows how can i show the records into the Datagrid or the flexGrid???
I tryed the Refresh property but it doesn`t work...
When i open the SQL statement into the Form_Initialize() sub then it works just fine....
Problems Filtering Records To Display On Datagrid
I have a datagrid, command button and an ADODC bar.
I need to display filtered records from a database. I used NWIND.mdb (Access) for ease of explanation.
The filter is in sql "SelectTitle ofCourtesy, count (TitleOfCourtesy) as Quantity, Region FROM Employees Group by TitleofCourtesy"
I implement this SQL sentence in design time. I put into the ADODC1 recordsource's CommandText (SQL) ; ADODC1.CommandType = adCmdText and bind the datagrid to this ADODC1.
What I want to do is to put this record filtering during runtime. As in I want to do this in code. Can anyone help?
PS: I also have this error: "Syntax Error in FROM Clause"
Thanks in advance
Help, I'm Trying To Display 3 Million Records In A Datagrid InASP.NET
I'm trying to display 3million records in a datagrid in ASP .Net and I juct can't figure out any solution. I tried a datareader but then I woun't be able to page back and forth because its a foward only curser I also tried using a server side cursor but that only took 20min to make. I know I'm not going to be able to store the 3million in memory but I need some kind of way to scroll through the records back and forth.
Display Retrieved Records From Text File On Datagrid
I have created the file as:
Code:
Open App.Path & "T1.Txt" For Append As #1
Print #1, s
Close #1
I am using the following code for retrieving values:
Code:
Open App.Path & "T1.Txt" For Input As #1
Do While Not EOF(1)
Line Input #1, s
Loop
Close #1
I want to store the data in a DataGrid. How to do so?
Display Retrieved Records From Text File On Datagrid
I have created the file as:
Code:
Open App.Path & "T1.Txt" For Append As #1
Print #1, s
Close #1
I am using the following code for retrieving values:
Code:
Open App.Path & "T1.Txt" For Input As #1
Do While Not EOF(1)
Line Input #1, s
Loop
Close #1
I want to store the data in a DataGrid. How to do so?
When I Select In Combo Related Records Display In Grid, Few Records Are Not Displaying
I think this is the right place to post this, without knowing i place this in other discussion.
I am new.
Actually my project's Purpose [in the Form1, two combo boxes listing ItemCode and Description from two tables, where ItemCode is equal in both tables, after selecting in combo, the related record displayed in the Form2-MSHflexgrid]
Everything is working perfectly except one thing. Only three records is not displaying the details among the 1600 records
OFFICE 2000 W32 EN INT'L
MONEY 2000 W32 ENG INT'L
COMPAQ PRESARIO MV500 15" MONITO . this 3 records are in the present in the table and the ItemCode is also equal. The 3 belongs to Description field. I check through in another way, by giving the Itemcode in the first combobox, it displays correctly the details of all records. where as in the second combobox only these three is strucking up.
where as PRESARIO MV500 15" MONITOR is also a record similar to the three records but it is displaying.
I don't know this is because of any string error or something else. What's the problem, Kindly reply me.
Form_Activate()
If Form1.optItemcode.Value = True Then
sqls= "selecttab1.Itemcode,tab1.Description,tab1.Product,tab2.warehouse,tab2.Qty,tab2.Amt,tab2.Amt * 5/100 from tab1,tab2 where tab1.Itemcode=tab2.Itemcode AND tab1.Itemcode='" & Form1.cmbItemCode.Text & "'"
End If
If Form1.optDesc.Value = True Then
sqls="select tab1.Itemcode,tab1.Description,tab1.Product,tab2.warehouse,tab2.Qty,
tab2.Amt,tab2.Amt * 5/100 from tab1,tab2 where tab1.Itemcode=tab2.Itemcode AND tab2.Description='" & Form1.cmbDescription.Text & "'"
End If
rst.Open sqls, cnn, adOpenStatic, adLockReadOnly, adCmdText
If rst.RecordCount = 0 Then
Me.Hide
Form1.Show
MsgBox "No Matching RECORDS !", vbExclamation, " * Invalid Entry"
End If
because of this I am not able to finish my project. Kindly help me. My mail id is
itchocks@rediffmail.com
Thank you very much,
CHOCK.
Hai !!!
Question:Also send it to my mail ID. I did'nt get practice with forums, I don't know where to search this again.
<HTML>
<B><font color="#008000">HAVE A NICE DAY !</font></B>
<HTML>
How To Extract Records And Display Report Of Records That Are Blank
I am using the databound control in a new vb 6 program for a database of complaints. I have name , address, team, response number, open date, assigned date and completed date and some other fields that are all bound to a data2 control. I need a query that will return a report that lists all the records for a specified month (using a drop down box)with no Date_Complete (nothing entered into the field). So if the user selects March -- 2000 in two different drop down boxes. I need fields that have nothing in the Date_Completed field to print in a report. Only the records that have nothing in the Date_Complete fields should print or make the report. So the user can go back and make sure these complaints get completed. I would really appreciate the help; desperate to finish my program and it is overdue; Also, I have been using the data report feature but am open to suggestions. I don't know crystal reports at all so I need some exact and specific code here -- thanks!!!
even help w/ code using the drop down boxes to extract the data -- for example if the user select March in one drop down box and 2000 in another drop down box. I need the records that are not completed (Date_Completed) field to only show up in the report for March 2000.
How To Extract Records And Display Report Of Records That Are Blank
I am using the databound control in a new vb 6 program for a database of complaints. I have name , address, team, response number, open date, assigned date and completed date and some other fields that are all bound to a data2 control. I need a query that will return a report that lists all the records for a specified month (using a drop down box)with no Date_Complete (nothing entered into the field). So if the user selects March -- 2000 in two different drop down boxes. I need fields that have nothing in the Date_Completed field to print in a report. Only the records that have nothing in the Date_Complete fields should print or make the report. So the user can go back and make sure these complaints get completed. I would really appreciate the help; desperate to finish my program and it is overdue; Also, I have been using the data report feature but am open to suggestions. I don't know crystal reports at all so I need some exact and specific code here -- thanks!!!
even help w/ code using the drop down boxes to extract the data -- for example if the user select March in one drop down box and 2000 in another drop down box. I need the records that are not completed (Date_Completed) field to only show up in the report for March 2000.
Click Datagrid Row And Display Details To Another Datagrid
hello there..here i need help. i have a datagrid that retrieve data from database.what i want to do with the datagrid is when i click any rows of the datagrid it can display the details of the data (refer to the row that i click) to another datagrid.
is there possible to be done ?
i want to know if there is any procedure that can capture the datagrid row that i clicked
Display Records
I have a database with address and phones. The phones table looks like this:
Phone / Description / Type
555-55555 / Phone in kitchen / Home
555-55551 / Phone in car / Mobile
How do I display this on a form?
Help Me Display All My Records
My simple VB program is designed to grab information from a very simple Access table and display the names of 12 baseball players in a text box. I can do it when I use a Data Grid, but can only display the last record when I use a text box to display my output. Can anyone fix my program/tell me what I'm missing so that I can display all 12 records in my text box?
Here is my code:
(i always try but my files never upload for some reason - it's a simple file called players.mdb)
--------------------------------------------------
Dim CN As ADODB.Connection
Dim RS As ADODB.Recordset
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdGetLine_Click()
Call GetLines
End Sub
Private Sub Form_Load()
Set CN = New ADODB.Connection
Set RS = New ADODB.Recordset
CN.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=c:anakinvbGetPlayersplayers.mdb;"
End Sub
Public Function GetLines() As Boolean
Dim oneLine As String
If RS.State = adStateOpen Then RS.Close
RS.Open "Select * FROM TblPlayers", CN, adOpenStatic, adLockBatchOptimistic
RS.MoveFirst
Do Until RS.EOF
oneLine = vbNullString
oneLine = (RS("PlayerName")) & ","
oneLine = oneLine & (RS("Team")) & ","
oneLine = oneLine & (RS("Position"))
txtPlayers.Text = oneLine
RS.MoveNext
Loop
End Function
Public Function GetJString(ByVal JValue As Variant) As String
If IsNull(JValue) Then
GetJString = ""
ElseIf IsEmpty(JValue) Then
GetString = ""
Else
GetString = CStr(JValue)
End If
End Function
--------------------------------------------
thx,
Anakin
How To Display Records If There Is.....
Hi everyone
I have one table in sql server. there is null values in fields of this table. When i try to display records in combobox. it doesnt display anything.
using this code
while not rst.eof
combo1.additem rst!cust_name
rst.movenext
wend
rst.close
set rst =nothing
it is not working. Also i am trying to display records in text box then it is displaying that invalid use of null.
So please help me out
Thanx in advance
Display Records
I have a CommandButton & a Label in a VB Form. When a user clicks the CommandButton, I want the records from a database should get displayed in the label. Can this be done? This is what I tried but am getting an error:
Private Sub Command1_Click()
Dim objConn ' As ADODB.Connection
Dim objRS 'As ADODB.Recordset
Dim connString 'As String
Set objConn = New ADODB.Connection
Set objRS = New ADODB.Recordset
connString = "Provider=SQEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=SQLServerName;Data Source=DBName"
objConn.Open connString
objRS.Open "tblProducts", objConn
Do Until (objRS.EOF)
Label1.AddItem objRS("ProductName")
objRS.MoveNext
Loop
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
End Sub
The error is being thrown in the line in blue color.
Thanks,
Arpan
Display Records
,Hi all, i have a huge access database and i want to display all the records in a grid,actuallyi'm using Datagrid,but i wana 2 know which one is best to use "datagrid" Or "MsFlexGrid", could anyone advice me,which will better suite my huge database for displaying the record,thanks advancely all
Display 10 Records At A Time
Can anyone help?
Ive been trying but cant seem to figure it out.
Here is the code that displays all the records , how would i go about display 10 records and a time
---------------
Do While Not rcst.EOF 'check for the end
flashtext = rcst.Fields(0).Value
xWin.SetVariable "r" & recordnumber, flashtext
recordnumber = recordnumber + 1
rcst.MoveNext 'goto the next record
Loop
-------------------
//This writes the records to the fields i want, but i dont know how to set up a button to display 10 at a time
TIA
Can't Display All Records In Flexgrid...help!!!
I'm having ploblems loading an access db of about 4000 records into a flexgrid. For some reason the listings stop at ~700, although the recordset.recordcount = 4093. When I sort the list, records from later in the database show up, but it still won't list more than 700. My flexgrid does not have a maxrecords setting; infact, I set it to 4093, and every row after 700 was blank. It's like the command to set the grid to the recordset is cutting off it's loading process. Access does the same thing to me, by the way: It will open the file to about 700 records, and then it will finish the listing about a second later. Here's the code I'm using, if anyone can help. Thank you very much in advance!
Code:
Private Sub Form_Load()
Dim dbConn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim cMonth As String
Dim cYear As String
Dim fileString As String
If Trim(Dir("c:Program FilesAPPCIMdbLog.txt")) <> "dbLog.txt" Then
cMonth = "august"
cYear = "2002"
Else
Open "c:Program FilesAPPCIMdbLog.inf" For Input As #10
Line Input #10, fileString
cYear = Mid(Trim(fileString), 2, (Len(Trim(fileString)) - 2))
Line Input #10, fileString
cMonth = Mid(Trim(fileString), 2, (Len(Trim(fileString)) - 2))
Close #10
End If
Set dbConn = New ADODB.Connection
dbConn.Open modConnManager.ConnManager((cMonth & ".mdb"), ("clients" & cYear & ""))
Set rs = New ADODB.Recordset
rs.MaxRecords = 5000
rs.Open "SELECT * FROM Clients", dbConn, adOpenKeyset, adLockOptimistic
rs.Update
grdData.Clear
Set grdData.DataSource = rs
frmDebug.txtDebug(4).Text = dbConn.ConnectionString
End Sub
Restricting The Display Of Records
Restricting the display of records
I created an application for a doctor in VB6 and Access 2000.
In a screen - lots of listboxes are loaded with data and siplayed to the doctor - so that the doctor can click a listitem in respective listbox and save the data. An example would be 5 listbox in AddPatient screen.
With the passage of time, the data that the lisboxoes display has increased tremendously. Now when a form is loaded one of the listbox displays 20 thousand appx. records, while other listboxes display 20 thousand appx. Records. In total at the moment some 40 thousand records are being displayed. Consequently when the application is run without this screen it occupies 8078 KB space in the memory (as seen in Task Manager) and when this screen is displayed the memory space occupied goes upto 26000 KB.
I have tried the following solutions:
1. In ADO recordset:- setting MaxRecords property. However, this property doesn't work with Access.
2. Using "Top" keyword in SQL statement. However, this only returns a selected no. of records and when the user surfs through the listbox rest of the records are not displayed.
3. Cachesize property in AD) Recordset, but of no help.
Limitations:
Have to display all records, so that the doctor can choose from the list. So I don’t have the option to use "Where" clause.
Can anybody help with a good solution?
Limiting Records To Display
Hi to all,
I have used MySQL's LIMIT feature when displaying records for a limited size say 50 per page. I want to know if MS Access has this kind of feature, or ADO itself? I have read about the PageSize, PageXxX properties of ADO, but many says that it does retrieve all the records in a table.
I found MySQL's LIMIT keyword excellent in displaying the "required" records only, and by dividin it by pages, you can be able to save overhead. What about MS Access? Does using the TOP keyword and by having a specified ORDER BY clause in my query will solve the trick?
Thanks and god bless.
How To Display Records In Flexgrid And When ...
Hi evryone
I have developing s/w.I want records to be displayed in flexgrid and when i double click on flexgrid the selected records must be displayed in related textbox.
Please help me
Waiting for positive reply.
Thnax in advance
How To Display Records In Combo
HI
i want to display records in combobox
i tried it like as given below but nothing is coming in combo box
private sub form_load()
dim i
rs.movefirst
for i=1 to rs.recordcount
combo1.additem rs.fileds(0).value
rs.movenext
next
end sub
but doesnt work
Please help me
waiting for reply
thanx in advance
How To Display Records In Combo
Hi everyone
I amdeveloping s/w regarding that one question,
How to display records of data in combobox. I have written it down program runs properly but records do not come in combo
Private Sub Form_Load()
cn.Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "autodata.mdb;Persist Security Info=False"
rs.Open "select * from billauto", cn, adOpenDynamic, adLockBatchOptimistic
Dim i
rs.movefirst
For i = 1 To rs.RecordCount
combo1.additem rs.Fields(0).Value
rs.MoveNext
Next i
Please help me
Use DTPicker To Get Records From DB And Display It
Hi! I'm new to DTPicker. I have two DTPicker named dtpstart and dtpend.
I would like to use the DTPicker to get data from Database table and display it in listview.
After displaying the data in listview i would like to create a report using crystal report 9.
Need help to get started with it.
Thanks!
Display Records In Flexgrid
hi,
i m new to vb.i wanted to know how to display records in a flexigrid.just a sample code.plz help me
regards
Display Certain Table Records In VB6
Hi,
i am trying to have VB display records based on one field within a Access table. I have a page of movie genre buttons, so that when clicked, it displays all of the movies from that genre. Genre is a field within each record of the table.
Also, if I have an ADO that lets users browse movies, how can I allow the user to select the current movie and display more info on another page.
Thanks,
Amanda
Display All Records In A Combo Box
I am using a bound combo box to display records. However, only the first record of the recordset is being displayed. How do I display all records?
Set cnnProvType = New ADODB.Connection
cnnProvType.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CustSvc;Data Source=POKEMON"
cnnProvType.Open
Set recProvType = New ADODB.Recordset
recProvType.Open "SELECT DISTINCT VendorType FROM VendorType " _
& "ORDER BY VendorType", cnnProvType, adOpenStatic, _
adLockOptimistic, adCmdText
Set dbcProviderType.DataSource = recProvType
Set dbcProviderType.RowSource = recProvType
dbcProviderType.DataField = "VendorType"
dbcProviderType.ListField = "VendorType"
dbcProviderType.BoundColumn = "VendorType"
Thanks,
Leroy
DataRepeater Does Not Display Records
I've read all the threads related to the DataRepeater, but I haven't seen anything describing the problem I'm having.
I followed the MSDN instructions for using the datarepeater control ( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconusingdatarepeatercontrol.asp ), but it isn't working for me. I tried both following the instructions exactly and substituting my field/control names to build the actual control I want and I get the same result.
In design view, the control is displayed in the datarepeater and I have bound the property names and data fields.
When I run it, the datarepeater is blank. I have confirmed that the adodc does have records in it's recordset by also having text boxes on the form that display the current record.
Any help is appreciated.
Rott Paws
Display Three Largest Records
I am trying to enter in a zip code in a combo box to show which service agents are the closest to the customers based on mileage. The milage would then be used to calculate the travel cost. How would I filter my results to just show the three cheapest milage costs? Below is my code I have been working with. I have gotten the results to show in subform, but I am not sure what VB code I should use to filter the 3 cheapests cost.
Appreciate the help
Private Sub command11_Click()
Me.Combo14.Value = Null
End Sub
Private Sub Detail_Click()
End Sub
Private Sub CalculateZip_Click()
Dim sqlString As String
If Not IsNull(Me.Combo14.Value) Then
sqlString = sqlString & " [Zodiaq Zip Locations_Zip] = " & Combo14.Value & " AND "
End If
If Len(sqlString) > 5 Then
sqlString = Left(sqlString, Len(sqlString) - 5)
Else
End If
Me.SA_Distance_Calc_subform6.Form.FilterOn = True
Me.SA_Distance_Calc_subform6.Form.Filter = sqlString
Me.SA_Distance_Calc_subform6.Form.Requery
Me.Refresh
' MasterForm.DoCmd.OpenQuery SQLCommand
On Error GoTo Err_CalculateZip_Click
' DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70
Exit_CalculateZip_Click:
Exit Sub
Err_CalculateZip_Click:
MsgBox Err.Description
Resume Exit_CalculateZip_Click
End Sub
I Need To Only Display The Last 30 Days Of Records
OK two problems about the same.
Problem #1
-------------
I need a query that will display only dates < 30 days old. Please help me. The query is going to be used on a report. I have the dates entered into fields in the table two different ways. One in format ##/##/#### and another way in 3 seperate fields to do calculations on. Because in VB I had to find when the task has to be completed again and do alot of math for each possiblity :(
I have a table that is keeping track of every task ever completed and they only want a report genereated that lists just the last 30 days. So the statement that I need would be hopefully in Access so I can just use the query from Access for an Access report.
Problem #2
-------------
Ok another wall that I am hitting is similar to that one.
I am needing to find the oldest of the tasks that are not completed yet and list them descending and return two dates.
I already have them listing descending. I have a field in the table that supplies [lastcomplete] date. I need to come up with a query that based on that date will return the first date(oldest) to the most current date. Now since the newest date can be irrelevant by saying return all dates with incomplete tasks. I just need to also return the oldest date and the newest date in the set. (This being from the one field [lastcomplete]
Another thing that might be need to know is that all of the tasks are incomplete becuase in VB when they finish a task I take the data from this table and put it into a history table and just change the [lastcomplete] date with the date that it was completed and such. They also just want to the last 30 days worth, so maybe something like taking the date in that field and comparing it to [date] (computer generated current date) and if less than 30 days old? Please supply code or examples if you could. I'm just new to programming and this is my first real project using SQL that differs from:
SELECT table1.*, table2.* FROM table2 INNER JOIN table1 ON table2.commonfield = table1.commonfield
So ya I've defiently got alot to learn with SQL.
Any help would be greatly appreciated.
This makes what . . . three things related that I am having problems with lol. O the joys of learning something new in the wonderful world of programming.
Thanks in advance,
Richard
I Want To Display Records In Flexgrid And When I......
Hi evryone
I have developing s/w.I want records to be displayed in flexgrid and when i double click on flexgrid the selected records must be displayed in related textbox.
Please help me
Waiting for positive reply.
Thnax in advance
How To Display The Number Of Same Records
HI, I want to know the code for display the same record in vb 6..For example i search for customer number 2444, but the records just to many and i want to show for example "There's 44 record for this customer"..Can somebody help me? Also i want to print that particular report..For example i have print button and when i click print it will print only one record..For example Customer number 2555 and only print that record..Thanks
Display Records Using Recordset
Dear all,
I had a form
Rollno
Name
Marks1
Marks2
Total
I designed a table in Access Named "Student"
i have used ADODC for Accessing Record
I Have written this code for Opening Database
Dim cn As New ADODB.Connection
'Connection Confirmation
On Error Resume Next
cn.ConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source=BMW.mdb;"
cn.Open
Debug.Print "Connection Object Created"
Dim rsUser As ADODB.Recordset
Dim sSQL As String
Set rsUser = New ADODB.Recordset
sSQL = "Select * From Student Where student_name = '" & txtname.Text & "' And Roll_no = '" & txtrollno.Text & "'
rsUser.Open sSQL, cnDb
How do I Display Record Which Has Rollno = 20 and Name= "John"
Thanks
Display Records In A Textfile
I've stored a recordset object in a variable useing the GetRows method,
I have to display data in a text file a certain way and this is where
I am having difficulty.
In the textfile each distinct InvoiceNumber will print on a separate line,
followed by CustomerID on a separte line. Under CustomerID is where I need
to show all of the delivery details for that particular Customer.
The number in quotes need to be hardcoded. <see code below>
Here is how it outputs now
"010000" & A.InvoiceNumber '(A being a table called Transactions)
"100000" & B.CustomerID '(B being a table called Customers)
"010000" & A.InvoiceNumber '(different invoice number)
"100000" & B.CustomerID 'may or may not be a different Cust.ID
I need to insert the following, each on new lines, after "100000" & B.CustomerID
----- this is where help is needed ---------
"500000" 01 '(the first record)
"550000" 01 A.ChargeToCompany
"600000" 01 A.PUCompany
"650000" 01 A.PhoneNUmber
"680000" 01 A.ContactName
"700000" 01 A.TransNumber
"500000" 02 '(the second record)
"550000" 02 A.ChargeToCompany
"600000" 02 A.PUCompany
"650000" 02 A.PhoneNUmber
"680000" 02 A.ContactName
"700000" 02 A.TransNumber
"500000" 03 '(the third record)
"550000" 03 A.ChargeToCompany
"600000" 03 A.PUCompany
"650000" 03 A.PhoneNUmber
"680000" 03 A.ContactName
"700000" 03 A.TransNumber
etc.
etc.
-----------------------------------------------
When the Invoice Number changes it repeats itself
"010000" A.InvoiceNumber 'different invoicenumber
"100000" B.CustomerID
"500000" 01
"550000" 01 etc. etc.
Here is the code so far:
Code:
vGetRS = rs.GetRows()
rs.Close
cnn.Close
'output results to file
EDIFileName = App.Path & "TestEDI.txt"
FileNO = FreeFile
Open EDIFileName For Output As FileNO
sOld = ""
vTitle = ""
For i = LBound(vGetRS, 2) To UBound(vGetRS, 2)
For j = LBound(vGetRS, 1) To UBound(vGetRS, 1)
If j <> 1 Then
If j = 2 Then
If vGetRS(j, i) <> sOld Then
vTitle = "010000" & vGetRS(j, i) 'InvoiceNumber
sOld = vGetRS(j, i)
End If
Else
stemp = "100000" & vGetRS(5, i) 'Customer ID
End IF
End If
Next j
---------------------------------------------
'this is where what I mentioned above needs to take place
---------------------------------------------
stemp = Trim(stemp)
stemp = Left$(stemp, Len(stemp) - 1) & vbCrLf
If vTitle <> "" Then
If sText = "" Then
sText = vTitle & vbCrLf & stemp
Else
sText = sText & vTitle & vbCrLf & stemp
End If
vTitle = ""
Else
sText = sText & stemp
End If
stemp = ""
Next i
Print #FileNO, sText
Close #FileNO
I am wondering if this can be broken up into sub or function
procedures, but I am not sure how to go about doing that.
I've left off a number of fields for simplicity.
I am greatful for any help!
Filter Records To Display On Grid
Hello. Here is what I need someone's help with. I load my records for view on the MSflexgrid. Because my records contains different school years, if I only want records of a specific school year to be loaded onto the grid, I have to enter in a filter or a school year such as 2005-06. Then only the records matching with my filter are loaded to the grid, but I also get some blank rows, which are the records that are filtered out. I think it has to do with counter of the For-Loop, but I have been unable to find an answer for it. I don't want the blank rows. Can anyone show me how to get rid of the blank rows? Below is my code:
Code:
Private Sub ShowGridTable()
Label1.Visible = False
MSFlexGrid1.FixedRows = 0
MSFlexGrid1.FixedCols = 0
MSFlexGrid1.TextMatrix(0, 0) = "Line"
MSFlexGrid1.TextMatrix(0, 1) = " Child's Name"
MSFlexGrid1.TextMatrix(0, 2) = "Teacher"
MSFlexGrid1.TextMatrix(0, 3) = " Dental Exam"
MSFlexGrid1.TextMatrix(0, 4) = " Physical Exam"
MSFlexGrid1.TextMatrix(0, 5) = " Hgb/Hct"
MSFlexGrid1.TextMatrix(0, 6) = " Lead"
MSFlexGrid1.TextMatrix(0, 7) = " Hearing"
MSFlexGrid1.FixedRows = 1
MSFlexGrid1.FixedCols = 2
MSFlexGrid1.ColWidth(0) = MSFlexGrid1.Width * 0.05 ' Line number
MSFlexGrid1.ColWidth(1) = MSFlexGrid1.Width * 0.21 ' Child's name
MSFlexGrid1.ColWidth(2) = MSFlexGrid1.Width * 0.1 ' Teacher
MSFlexGrid1.ColWidth(3) = MSFlexGrid1.Width * 0.21 ' Dental exam
MSFlexGrid1.ColWidth(4) = MSFlexGrid1.Width * 0.21 ' Physical exam
MSFlexGrid1.ColWidth(5) = MSFlexGrid1.Width * 0.1
MSFlexGrid1.ColWidth(6) = MSFlexGrid1.Width * 0.1
MSFlexGrid1.ColWidth(7) = MSFlexGrid1.Width * 0.1
Dim i As Integer
Dim FileStatus As DBStatusRecord
Get StatusFileNumber, 1, FileStatus
ReDim NameList(FileStatus.NumberofMainRecords)
SortFirstName ' Sort by first names
For i = 1 To FileStatus.NumberofMainRecords
Get MainFileNumber, NameList(i).recnum, mRecord ' Get sorted list
If YearFilter = "" Then 'All records will be loaded to grid table
With MSFlexGrid1
.WordWrap = True
' Setup increment rows equal to records length
.Rows = FileStatus.NumberofMainRecords + 1
.Col = 0
.Row = i
.Text = Str(i) ' Line numbers
.Col = 1
.Text = Trim(mRecord.FirstName) & " " & Trim(mRecord.LastName)
.Col = 2
.Text = Trim(mRecord.Teacher)
.Col = 3
.Text = Trim(mRecord.FormFUNote(0))
.Col = 4
.Col = 5
.Text = Trim(mRecord.FormFUNote(2))
.Col = 6
.Text = Trim(mRecord.FormFUNote(3))
.Col = 7
End With
End If
' Allow only records matching with the filter, which is the school year,
' to show on the grid.
If YearFilter = Trim(mRecord.SchoolYear) Then
With MSFlexGrid1
.WordWrap = True
.Rows = i + 1 ' FileStatus.NumberofMainRecords + 1
.Col = 0
.Row = i
.Text = Str(i) ' Line numbers
.Col = 1
'.Row = i
.Text = Trim(mRecord.FirstName) & " " & Trim(mRecord.LastName)
.Col = 2
.Row = i
.Text = Trim(mRecord.Teacher)
.Col = 3
.Text = Trim(mRecord.FormFUNote(0))
.Col = 4
.Text = Trim(mRecord.FormFUNote(1))
.Col = 5
.Text = Trim(mRecord.FormFUNote(2))
.Col = 6
.Text = Trim(mRecord.FormFUNote(3))
.Col = 7
.Text = Trim(mRecord.FormFUNote(4))
End With
End If
Next i
FrmFormGrid.Caption = " Health Forms Grid Table Records: " & Str(i - 1)
End Sub
Thank you in advance.
Mydanvuue
How To Display Records As Desired Order If....
Hi everyone
I am using crystal report 8.0.1.0. i am getting all data in report as i desire.
i am displaying all records as given below order in report.
company name:
contact person:
address:
p.o.box:
zip code:
phone no:
fax:
email:
ok i am getting records as i want but if is it possible that suppose there is no data of phone no and fax.
then i want to be displayed data in reports in same order but there should not be any space between zip code and email as given below.
company name:
contact person:
address:
p.o.box:
zip code:
email:
after zip code there must email bcoz there is not data for phone no and fax.
if there is data for this then it should be displayed.
waiting for reply.
Best regards,
ASIF
Display Multiple Records From Table
Hi,
I'm on a vbproject where i have to display all the expenses occured this month in a form along with the total income in balance sheet design.
I have no idea how to display all the expense records that belong to this month in a grid format.please help me as to how to solve this issue, as i too new to this concept. I use single table to bring in all the details and use adodb connection.Thanks in advance.
Display Data Records Into Listview
hi, how to display the records from my database.mdb into a listview? with 4 columns and each columns display the field names..
my database has 4 field names...
br
Display SQL Server Records In Combobox
Hello...
Can anybody help me to insert a particular record from SQL Server database to a combobox in VB...
I have just selected the record from the table in the following manner:
rst.Open "select Location from Ticker_Loc_Detail", cnn, adOpenStatic, adLockOptimistic
i just want to put those records of the field "Location" in a combobox...
please help me out...
expecting a reply soon from someone..
thanx in advance..
Looking For A Way To Display About 100 Records From A Recordset Into A Form
Hi all!
I am looking for a way to display about 100 records from a recordset into a form. I know there are various grids like msflexgrid, mshflexgrid etc to display them, but I think they are not very flexible. Also I want to be able to select one of those records and then modify them if required. Is control array a good idea????
Please suggest a better way.
Shruti
Data Control To Display Only Certain Records
i have a subroutine that prompts the user for a case number; if they type in 000000 i need all the cases w/ 000000 to show up in the form and the user can click the arrow on the databound control to go through only the records with a case number of 000000
also how could i show all these records using a grid; i need a number they input to pull up a grid w/ all the records relating to that inputted number; like the 000000. So every case number w/ 000000 would appear in the grid. It needs to be exchangeable though depending on what number is entered by the user.
Need serious help!!!!
Thanks
How To Display Records In Vbscript In Table
hii theree
I have a set of records in a table in acces. I want to display these records in a table format using vbscript/ADO connection. can anyone tell me how to do this for all the records since vbscript does not allow the table tag to work in its own tag...so plss tell me how to do this ...
thanks
ravi
Display Three Largest Records In Subform
I am trying to enter in a zip code in a combo box to show which service agents are the closest to the customers based on mileage. The mileage is used to calculate the travel cost which was done in a previous query. How would I filter my results to just show the three cheapest milage costs? Below is my code I have been working with. I have gotten the results to show in subform, but I am not sure what VB code I should use to filter the 3 cheapests cost.
Appreciate the help
Here is the code I have thus far
Private Sub command11_Click()
Me.Combo14.Value = Null
End Sub
Private Sub Detail_Click()
End Sub
Private Sub CalculateZip_Click()
Dim sqlString As String
If Not IsNull(Me.Combo14.Value) Then
sqlString = sqlString & " [Zodiaq Zip Locations_Zip] = " & Combo14.Value & " AND "
End If
If Len(sqlString) > 5 Then
sqlString = Left(sqlString, Len(sqlString) - 5)
Else
End If
Me.SA_Distance_Calc_subform6.Form.FilterOn = True
Me.SA_Distance_Calc_subform6.Form.Filter = sqlString
Me.SA_Distance_Calc_subform6.Form.Requery
Me.Refresh
' MasterForm.DoCmd.OpenQuery SQLCommand
On Error GoTo Err_CalculateZip_Click
' DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70
Exit_CalculateZip_Click:
Exit Sub
Err_CalculateZip_Click:
MsgBox Err.Description
Resume Exit_CalculateZip_Click
End Sub
Records Display Taking Time
Hi all
i have to display items about 25000 in Flexgrid.
so when i am trying to display them in grid it taking so much time about 4 sec.
so pls help me out
SQL Server 2000 as data base
bye
Display Records With Selecting In Treeview
Hi there,
I did the tutorial / FAQ about filling the treeview with a access database. It all works fine. (Big thanx for that)
Now i wan't to use the treeview to control a form next to the treeview.
For example: When the user selects a customer-name in the treeview, i wan't to display all the customerdetails in the form next to the treeview.
Is this possible ? and are there tutorials on this subject ? i've searched the whole forum, but couldn't find any solution.
I hope somebody can help me.
Big Thanx in Advance
Greetz ActionStart
Display Counter For Number Of Records
Dear all,
In my project I display via my first form using Form Load event the data from SQL server tables with ADO data control . Number of data is found by Recordcount properties. The problem is that as the data growing bigger it take quite time to finish searching all the records. My concern is how to display the searching counter so that at least I know that the program still running. I hope you can give me the detail of the code to display such counter.
Thanks a lot
|