|
-
Oct 20th, 2000, 12:16 PM
#1
Thread Starter
Member
I have a grid linked to a data control. I went into the properties of the grid and added a column.
Now whenever I run the program, I get a message "Item not found in this collection" whenever I refresh the data control or do a move first, etc.
Any ideas or suggestions????
-
Oct 20th, 2000, 10:32 PM
#2
Add the column to the database that is linked to the data control. If it is linked then I am pretty sure it has to match the source.
Or just use a grid that you can populate with code and then add your extra column.
-
Oct 25th, 2000, 04:57 PM
#3
Thread Starter
Member
The connection for the data control is already pointing to the entire table, but the grid itself is only displaying some of the columns. I simply added another column for a field from the same table that the data control is already pointing to. So it should already be able to see it (and indeed does since it displays the information), but the data control seems confused....
-
Oct 25th, 2000, 05:20 PM
#4
Hyperactive Member
Right click on your datagrid within VB and select retrieve fields. It will ask you if you want to reset you columns (or something like that)..just say yes and your additional fields should appear in your grid.
-
Oct 27th, 2000, 04:45 PM
#5
Thread Starter
Member
That sounded like it would work, but then I get error 'object variable not set'
-
Oct 27th, 2000, 05:13 PM
#6
Hyperactive Member
can you post some of your code?
-
Oct 31st, 2000, 05:43 PM
#7
Thread Starter
Member
normal type code
datBedservice.Connect = gOraConnect
datBedservice.RecordSource = "select rowid, bed_services.* from fim.bed_services where facility_id = '" + gOraFirstStation + "' and case_id = " & CStr(pRecordID) & " order by discharge_date"
datBedservice.Refresh
If Not (datBedservice.Recordset.EOF And datBedservice.Recordset.BOF) Then
datBedservice.Recordset.MoveFirst
The grid shows what I want it to, but the crazy error message appears at refresh and movefirst :| If you say OK to it, you can continue on, but that is irritating.
-
Oct 31st, 2000, 08:57 PM
#8
Lively Member
Sorry if this is a little off tangent - hope I'm not giving you a bum steer, but I think you may have to use the Set statement to set the datacontrol to the recordsource. I use the following to dynamically load a grid with a recordset produced from an SQL statement, as below. (The variable DataBaseFile is the DB name and path).
Using DAO.
SQLStatement = "Select [Cust ID], [Customer], [First Name], [Shipping Address], [Shipping Suburb], [Phone Number] from [Customers] order by [Customer] ASC"
Set rcsCustSelect = MainDB.OpenRecordset(SQLStatement)
datCustomerSelect.DatabaseName = DataBaseFile
Set datCustomerSelect.Recordset = rcsCustSelect
grdCustSelect.ClearFields
grdCustSelect.ReBind
grdCustSelect.Refresh
Hope this is of some help.
Adrian.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|