Unable To Change Data In The Data Grid
Dear sir/madam;
I have a form with a data grid written with VB version 8176. The project is working fine with my computer using this version 8176 but when I run the same project at school. The data grid is not allowing me to change any data in any column in the grid at all. The version of VB in school is 9899 and have SP5 as well. Could you please help me resolve this problem. My school project is due in one more week and I have to get this data grid working. Please help, please!
Thank you for your attention.
Abdul.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Data Grid: How To Enter And Change Data?
Hi, folks!
I've added a Datagrid control to my form and have set its properties like this:
AllowAddNew = false
AllowDelete = false
AllowUpdate = false, on the form load event
There's a button called "Add New", with the following module:
MyDatagrid.AllowAddNew = True
Mydatagrid.AddNewMode
But when I click this button, this error message appears:
Invalid use of property (regarding the 2nd line, property .AddNewMode
There's another button called "Changes", with the module:
MyDataGrid.AllowUpdate = True
MyDataGrid.EditActive
And the same error message appears for the .EditActive property.
What I am doing wrong?
I'd like to allow the user to change or add new records only after clicking the proper buttons. I've done with another forms, but that's the 1rst. time I work with the DataGrid Control.
Please, help!
Thanks in advance for any ideas,
Roselene
Change The Data Field In Data Grid
Hi all,
I have an ADODC control, namely Adodc1, having the sql statement as below :
sqlstr = "select to_char(IN_DATETIME,'dd-mm-yyyy hh24:mi:ss'),
, other_field from table1"
and the Adodc1 is bind to DataGrid1.
Upon clicking the IN_DATETIME column header, i wish to sort the recordset by IN_DATETIME. I use the following codes in the DataGrid1_HeadClick(ByVal ColIndex As Integer) function:
***************************************************************
strColName = DataGrid1.Columns(ColIndex).DataField
Adodc1.Recordset.Sort = strColName & " DESC"
***************************************************************
However, it gave me error as below whenever i click on the IN_DATETIME column :
****************************************************************
run-time error '3265': Ado could not find the object in the collection corresponding to the name or ordinal reference requested by the application.
****************************************************************
I believe it is because of the sql i used in Adodc1 as the data field name in Adodc1 is recognised as :
to_char(IN_DATETIME,'dd-mm-yyyy hh24:mi:ss')
Is there anyway i can set the ADODC recordset field name manually in the code? I tried :
Adodc.Recordset.Fields(ColIndex) = strColName
but it gave me the following error :
****************************************************************
run-time error '91':
Object variable or With block variable not set
***************************************************************
Due to some reasons, i must use to_char(IN_DATETIME,'dd-mm-yyyy hh24:mi:ss') in my sql instead of IN_DATETIME.
Can anyone give me some hints how should i go about it? Thanks in advance.
Change Data In Data Grid
Hello Friends,
I am developing one application in which I want to display data in data grid from one table. Now I want to add one column in which I want to enter data and as per entered data I want to update values in other columns. Plz can u help me how to do that using Data Grid? Plz reply soon
Thanks
How To Change The Color Of Data Grid
I have Data Grid on Form and Form Backgroud is set to Dark Blue, but when I change the back color of Grid, the only Back Color of Row is changed, rest of grid color remain same. How Can I change the entrie color of Data Grid to Back Color of Form. Please help
How To Change The Back Color Of Data Grid
I have Data Grid on Form and Form Backgroud is set to Dark Blue, but when I change the back color of Grid, the only Back Color of Row is changed, rest of grid color remain same. How Can I change the entrie color of Data Grid to Back Color of Form. Please help
VB6.0 Data Grid, Odd Behaviour In Change Event
Hi All,
I have come across a problem today that is really bugging me and hope someone here can help. Basically what is happening is the following:
1) I have a data item which reads in data from table in the database called RECURRING_FREQUENCIES, which contains two fields; RECURRING_FREQUENCY_ID and RECURRING_FREQUENCY_NAME
2) The data source is linked to a DBCombo called db_recurreceFreq
3) The Change event for the drop-down is defined as there is one option in the database, which requires some other objects to be enabled.
4) If the user selects an option other than the checked one then it all works fine, but if they do select the checked one then the BoundText portion of the drop down suddenly contains RECURRING_FREQUENCY_NAME instead of RECURRING_FREQUENCY_ID
5) I have tried recreating all the onjects, but to no avail!
My code for the Change even is as follows:
CODE ' if it is user defined then enable the disabled text boxes
If (Me.db_recurrenceFreq = "User-defined") Then
Me.label_userFreq.Enabled = True
Me.text_userInterval.Enabled = True
Me.combo_userFrequency.Enabled = True
Me.text_userInterval.SetFocus
' otherwise disable them
Else
Me.label_userFreq.Enabled = False
Me.text_userInterval.Enabled = False
Me.combo_userFrequency.Enabled = False
End If
Change Column Font In Data Grid Control
hi..
I want to change the font of a column in data grid control, without
changing it for other columns.. is it possible to do it?? MSDN says
that each column has its own font property but i am not able to find
the way of changing it.
Anybody can help me do it.
Thanks in advance
Darsin
VERY URGENT!!!...data Report (unable To Bind To Data Member)
I have a problem with my data report...
I have this form with a DTPickert o allow user to select a date...and a 'Show' button to show the report...
The problwm is that after viewing the report and closing the form...when I open the same form again for the second time...it gives me an error message saying 'Unable to bind to data members'...but I can still run the program and view the report...
But I just do not know why the error message pops up...
any solutions to it...
any help would be much appreciated
Unable To Bind Data Filed Or Data Member
Hi, there,
I have some trouble to rebind a ADO data source to the textField. Here is the code:
private sub cmdRefresh_Click()
Set txtJurisO_NAME.DataSource = deJuris
Set TxtAddressAddr1.DataSource = deJuris
end sub
where each of these two controls corresponds to a different command in the deJuris environment. The first two times I click the refresh button, everything works fine. Then when I click it further more times I got the error message
Runtime error 545: Unable to bind to field or datamember "XXX"
Anybody has any clue?
Hongsheng
Displaying Data In A (data Grid / Flex Grid)
hi i would like to know how to connect to a Access database and display all records in a flex grid in VB
also i would like to know how to achive the above task from a SQL dadabse using ADO.. in VB
Plz help me...
Shabbeer
Printing The Contents Of A Data Grid - Data Report? Can Be Packaged?
Dear Friends,
I wish to provide a function to print the content of a data grid like that in Excel, including grid lines and column headers. But I don't want to use the capture image method of the grid and send to the Printer object because this is not applicable if the list is longer then the grid height.
So do I need to use data report? I just notice its existenece in the Designers in the Project Explorer of VB IDE. Can the project using DataReport be packaegd up as a standard standalone exe for installing on a new machine?
If special skills or tips are there, please kindly let me know.
Thank you very much for your help
How To Insert Temporary Data In Access(table) Using Data Grid
How to insert data into a table using a data grid.
A little background,i am using SS TAB in my forms i need to hold data temporarly im my data grid
and then finaly at click it should be inserted in the table.The SS TAB is linked to ADOC,which is inturn
linked to the table in access.
How To Insert Temporary Data In Access(table) Using Data Grid
How to insert data into a table using a data grid.
A little background,i am using SS TAB in my forms i need to hold data temporarly im my data grid
and then finaly at click it should be inserted in the table.The SS TAB is linked to ADOC,which is inturn
linked to table.
Edited by - manav74 on 10/29/2003 1:01:07 AM
SHeridan Data Widgets 2 Data Grid Problem
I have a form VB Tab control on it with three tabs, one each for "Query Setup", "SQL Display", and "Query Results". Tab # 3 (Query Results) has a Sheridan Data Widgets 2 datagrid on it attached to a standard data control. When the form initially loads the grid is automatically filled with the fields of the entire database. So far so good, that's what I want by default.
However, if the creates an SQL on tab #1 (Query Setup) and the statement uses less fieldnames (columns, ie only First, Middle and Last names instead of all fields) than it had on the initial load the grid only dislays the first field. The SQL statements are correct.
I have even tried replacing the Sheridan grid with the VB5 data grid and it works fine so I must be missing something here, perhaps a setting or something.
My supporvisor wants (likes) the alternate row colors of the Sheridan grid and wants it to be databounnd so I need to use thia grid.
Any ideas?
Rev. Michael L. Burns
Transfering Data Form A Data Grid To Excel
Hi guys.
I have a program in VB6 which load data from an access table into a data grid, now I need to trasfer that data in the grid to an excel sheet. How can I do this?.
Thanks in advance
Updating Data Directly In The Cell Of Data Grid
hi, i m wondering whether it is possible to update, insert or delete data directly in the cell of a data grid? i normally will let d user to click at d data grid and do these updates on a displaying text box. my user who is a microsoft excel user make a request that he hope d program will be as similar to excel as possible. i have look through d forum and didnt find a topic that can solve my problem. by d way, can we set different background colour or font colour for different columns? thanks~
Help On Viewing The Searched Data Inside The Data Grid
Can somebody teach me how to view only the searched data within the Data Grid, removing the other items inside the Data Grid that are not included in the search that I wrote insde the inputbox....Please add it to my code here:
Dim rsClone As ADODB.Recordset
Dim findpodealername As String
Dim strFind As String
findpodealername = InputBox("Enter DEALER'S NAME:", "FIND DEALER'S NAME")
strFind = "Name = '" & findpodealername & "'"
'create a "copy" of the recordset, used so the current record pointer doesn't change..
Set rsClone = prodorderrs.Clone
With rsClone
'Move to the first record
.MoveFirst
'find the particular string
.find strFind
If Not .EOF Then
'Record has been found...
prodorderrs.Bookmark = .Bookmark 'moves to the found record in the source r/set
txt_pomonth = .Fields("MONTH")
txt_poday = .Fields("DAY")
txt_poyear = .Fields("YEAR")
txt_podealerID = .Fields("DEALER ID")
txt_poName = .Fields("NAME")
txt_poprodid = .Fields("PRODUCT ID")
txt_pocategory = .Fields("CATEGORY")
txt_poqty = .Fields("QUANTITY")
txt_pocolor = .Fields("COLOR")
txt_posize = .Fields("SIZE")
txt_pocash = .Fields("CASH")
txt_pocredit = .Fields("CREDIT")
txt_poamount = .Fields("AMOUNT")
txt_pobalance = .Fields("BALANCE")
Else
MsgBox "Invalid Dealer Name Entered Or New Order of products"
End If
.Close
End With
Set rsClone = Nothing
End Sub
Show Data In Data Grid Using Adodb
I want to display data in Data Grid using Adodb
------------------------------------------------------------
Private Sub Command1_Click()
Dim oRs As new ADODB.Recordset
con = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " + App.Path + "/Northwind.mdb"
oRs.Open "select * from customers", con, adOpenKeyset, adLockOptimistic
Set DataGrid1.DataSource = oRs
DataGrid1.Refresh
End Sub
------------------------------------------------------------
No error when it is run , but the Data Grid is still empty... still no data displayed.
What's wrong with my code ?
Adding Data To The Data Grid Using A Txtbox
I have a form named frmclient that has a datagrid in it which is already connected to a MS sql server through ADO. My problem is I want to add data in the data grid using a txt box.
is there a way to do this using only the "adodc.recordsource.addnew" source codes or do i really have to use stored procedures???
I Want To Display Data With Data Grid Object
hi evrry one
i am new in vb programming
and i want to display data from a database by the use of the datagrid object
i am able to get the data and display it in a combobox
but not with the data grid
to be more clear
in combo box
it was like this
----------->
...
..
.
Dim i
i = 0
While Not rs.EOF
Combo1.AddItem rs("ad_id"), i
rs.MoveNext
i = i + 1
Wend
...
..
.
<---------
how can i get the same data but in the datagrid
thanx in advance[color=blue][color=blue][color=blue]
Data Grid And Moving Inserted Data
Hi all,
I have a data grid that is used for input. When a user enters in a new row and updates it, I would like to put that information in another control. What event can I use to do this? I tried afterInsert and that gets fired at the wrong time (when the user goes to the new row).
Thanks,
Paul
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
Data Grid And ADODC's Data Source
Hi
I have 4 SQL tables and 4 ADODC's (one for each table) and also have 1 DataGrid
How do I change the datagrid's DataSource without adding a data grid for each sql table ?
If I change the DataSource, DataGrid's column caption, data Field, col width, col visible or not, will also
change..... how do I do that?
this is what I have for ONE Sql table:
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If IsNumeric(Text4.Text) = False Then
MsgBox "Week number?"
Else
Adodc1.RecordSource = "select * from " & pSqlTbl & " where DATE > 0 AND weeknum = " & Text4.Text & " and year = " & Text3.Text & ""
If Not Adodc1.Recordset.EOF Then
Adodc1.Refresh
DataGrid1.Refresh
DataGrid1.Visible = True
End If
End If
End If
Any ideas
Thank you
OF
Data Grid Control Is Not Filled With Data
Hi,
I hope someone can help me with this:
I made a class module to allow data grid control to get information from the class module.
Inside the class module I created I made a connection and recordset to trying to fill the datagrid control.
Can someone tell me what I did was wrong that my datagrid control is not filled with data?
Thank you very much!
===================
The code within the form where the data grid control is:
' Bind the DataGrid to the new DataSource datNames
Dim datNames As NamesData ' Class variable
' Set datNames = New NamesData
Set GrReport.DataSource = datNames
===============
Below is the class module
==========
Option Explicit
Const DB_CONNECT = "Provider=SQLOLEDB; Data Source=BSQL; " & _
"Initial Catalog=TestField; User Id=flduser;Password=flduser;AutoTranslate=No"
Private WithEvents rsNames As ADODB.Recordset
Private Sub Class_Initialize()
' Add the names of the new datamember to the DataMember collection
' This allows other objects to see the available DataMembers
Dim dbField As ADODB.Connection
Set dbField = New ADODB.Connection
Dim strSQL As String
Dim rsNames As Recordset
Set rsNames = New ADODB.Recordset
dbField.Open (DB_CONNECT)
strSQL = "select * " & _
" from dbo.Daily_PPR"
rsNames.Open strSQL, dbField, adOpenDynamic, adLockOptimistic
End Sub
Private Sub Class_GetDataMember(ByVal DataMember As String, _
Data As Object)
Set Data = rsNames
End Sub
================
Data Grid, Etc./Data Shape Recordset
Is it possible to bind the datagrid, the old flexgrid, etc. to a "DataShape" language recordset? I was able to bind them to regular recordsets, but not with the data shape. I know I could use the Hierarchical flex grid for this, but I don't like the way that control lays out all of the data horizontally. I'd like to have the initial data grid show the "Parent" side of the recordset, and then allow the user to click on an item and have the child/detail information pop up. Thanks in advance.
VB Code To Change Data In A Pivot Table Changes Wrong Data
Hi, I have a code that changes a field in several pivot tables which depends on what you put in a combo box. The combox box also reads off a pivot table. It worked fine until I changed my source data and now when I change the field all the pivot tables return a different field. Can anyone help?
Dim strGroup As String
strGroup = grouplist
Range("L2").Select
ActiveSheet.PivotTables("Company filter").PivotFields("Group").CurrentPage = strGroup
ActiveSheet.PivotTables("Age").PivotFields("Group").CurrentPage = strGroup
ActiveSheet.PivotTables("Bonus").PivotFields("Group").CurrentPage = strGroup
ActiveSheet.PivotTables("Convictions").PivotFields("Group").CurrentPag e = _
strGroup
ActiveSheet.PivotTables("Company").PivotFields("Group").CurrentPage = strGroup
ActiveSheet.PivotTables("Car Age").PivotFields("Group").CurrentPage = strGroup
ActiveSheet.PivotTables("Car Value").PivotFields("Group").CurrentPage = strGroup
ActiveSheet.PivotTables("Mileage").PivotFields("Group").CurrentPage = strGroup
ActiveSheet.PivotTables("Parking").PivotFields("Group").CurrentPage = strGroup
ActiveSheet.PivotTables("Cover").PivotFields("Group").CurrentPage = strGroup
ActiveSheet.PivotTables("Capacity").PivotFields("Group").CurrentPage = strGroup
ActiveSheet.PivotTables("Restrictions").PivotFields("Group").CurrentPa ge = _
strGroup
End Sub
Unable To Sort Data
On a worksheet, I have a button that executed the below code. This works fine. I also want this code to be executed when the other worksheet is selected.
Code:
Range("A8:Y500").Sort Key1:=Range("A8"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
That is currenly in a macro sub, which as I say, works fine. I have also put into worksheet_activate.
The error I get is "the operation requires the merged cells to be identically sized. Strangely, none of the cells I am sorting are merged. My thinking is that it was trying to sort the worksheet that has just been selected, so I tried the following to no avail;
Code:
worksheets("Critical Document Matrix").Range("A8:Y500").Sort Key1:=Range("A8"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Any ideas?
Unable To Receive Data From AS/400 To VB6
Hi guys,
I'm new here.
My question is all about error when sending and receiving data
from AS/400 to VB. Forgive me if this question is not suited for this forum. I've
been posting my question to many forum sites but no replies have been yet received.
Below is the list of software we use to develop our project:
1. VB6 with service pack 6
2. MS SQL Server 2005
3. MDAC 2.7
4. Crystal Report version 10
5. Windows XP sp 2
6. Visual Basic 6 Installer
7. AS/400
8. OS/400
9. DB2
10. .NET Framework
---------------------------------------------------------------------
The Project: Banking System
The Problem:
Our users encounter "timeout" when printing records in an on-line environment. The
VB6 interface will send messages to AS/400 then AS/400 will send result data (1KB
per sending) to VB6 to be printed. Say we're expecting 20 lines of printing. After
the 12th line is printed, a generic error "Timeout" is pop-up.
We adjusted the connection-timeout setting to 500 or even 3000 but this did not help
our problem.
In my development environment, the printing runs smoothly and no errors occur. Maybe
because the VB6, SQL Server and Crystal Report fully versions are installed in my
computer.
I tried to clone 1 computer (my computer is the source), and the result is good.
1. Do I need to install full-versions of VB6, Crystal Report 10, MS SQL Server 2005,
.NET Framework 2 to our users ??
2. Is it a network concern ?
3. What are your suggestions
Please help.
Thank you.
Unable To Update Data
hi all,
i having problem with DataGrid VB6.0 with MYSQL 4.1.Can someone help me...thanks in advance.
The scenario is like this
-------------------------
1). I created a Database table used VB 6.0 code.
let said, field is "Name" with varchar(100),"TEL" with varchar(50).
2). Then,i key in the data "Name" field is "kelvin","TEL" field is "123456".
3). After that, i bind the dataGrid with the table.The output show the data i key in previously correctly.
The problem is..
--------------------
When i want to update the data in the dataGrid,it (vb 6.0) gave me error saying "Data access error , 6106".
and i have already set datagrid.Update = True.
i notice is the length/size of the datagrid.
Eg. "kelvin" if i update to "jane" is ok..
"kelvin" if i update to "James Bond " ..ERROR
i think is because the datagrid..bind the data according to the
length of actual value, "kelvin" is 6 char, mean i cannot update the value that more than it..Why like that..??
anyone can help..?? because i can't update the..data..
Thanks and Regards,
=Elvis=
Data Environment && Data Grid
I've gotten so much help from everyone, and here's a new one.
I have DE to an Access database with numerous tables. This is what I want to happen...
I have a form where users can enter in a name (first or last name) in two separate text boxes. On clicking a button, the system then searches and then bring up a datagrid of possible matches. Then the user selects a record from the data grid, it brings ups the actual record with 50 or so fields.
Problem. How do I get the datagrid to refresh/filter every time a new search is performed? I tried to filter and get the error
"ARGUMENTS ARE OF THE WRONG TYPE, ARE OUT OF ACCEPTABLE RANGE, OR ARE IN CONFLICT WITH ONE ANOTHER"
One of the filters strings are:
DE1.rsNameData.Filter = ("LastName LIKE '" & LastName.Text & "%' AND FirstName LIKE '" & FirstName.Text & "%'")
Any suggestions? I really have come to like the DE and not multiple ADODCs since I have several tables to work with
Data Grid Data Entry
I am currently creating "cash register" for my school project.
I never see find VB books that imply in using "data grid" as means of data entry. But when I went to a departemnt sote, I saw the cashier used datagrid (or maybe something that looks like it) as a way to enter the item code. Now, I started to get confused, since I couldnt find any resource to lead me in using DataGrid as a way to entry my data then stored into the database. thank you
Data Environment To ADO In Data Grid
Code:
Private Sub Form_Load()
DE.searcBookCode
DataGrid1.DataMember = "searcbookcode"
DE.rssearcBookCode.Close
End Sub
does anyone know how to convert this code into ADO code in vb6?I used Data Enviroment (DE) in the code above.I want even a li'l idea how to connect this using ADO.
thanks a lot
Data Grid Not Displaying Data
Hi
I have a VB6 app that contains a Datagrid that is to be refreshed by and ADODC based on the text from a listbox which is stored in a string variable. There are 3 columns in the datagrid that need to be displayed and I have set the widths at design time and I want these to stay fixed at run time and after the datagrid being refreshed.
I am using the .HoldFields method and it does just that, however the data is not displayed in the data grid. If I use the same query with the .ClearFields method then the column widths are reset by vb but the data is displayed.
Code is
Ado.RecordSource = "Select 3 Columns From Table where ID = ' " & Variable & " ' "
Ado.Refresh
Datagrid.HoldFields
Datagrid.Rebind
DataGrid.Refresh
Has anyone got any ideas?
Data Grid For Data Entry
Hello........
I'm useing Data Grid for data entring. I use coding insted of ADODA data
control. But I can't do any typing (editing) the cellpointer. pls
help me any one who familiya with dara grid
Thanks'
Suchira
Retrieve Data From A Data Grid
I want to let the user search a data grid (column 0) for a vendors ID and return the vendors faxnumber (column 2).
How do I find the row containing the vendor ID and then return the fax number???
|