473,322 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

ADO: Sub Form Dynamic Binding

Hi,
I have a form and a sub form, data on sub form is build dynamic based on certain contid coming from some other form. I am able to view data readonly but cant append. whereas if simple form is used in tabular mode i can set form.recordset property and hence append data, whereas in case of sub form i cant use recordset property. Can any body help please...........

Following is the sample code

Dim cn As New ADODB.Connection
Dim ars As New ADODB.Recordset

cn.ConnectionString = "Provider=SQLOLEDB.1;Password=abc;Persist Security Info=True;User ID=sa;Initial Catalog=PKG;Data Source=ADT0293\SQLEXPRESS"
cn.Open
With ars
.ActiveConnection = cn
.CursorLocation = adUseClient
.Source = "Select * from tbllist where contid = '5506597'"
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open
End With
Forms!Form1!List.Form.RecordSource = ars.Source
ars.Close
Set ars = Nothing
Apr 12 '10 #1
0 1383

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: festiv | last post by:
Hi there, I want to learn how the compiler is implementing the dynamic binding. where can i read about this subject (the hole process). thanks.
22
by: James Cane | last post by:
Here's an interesting problem that someone might have an answer to... Some time ago, I wrote a set of utility classes which wrap up the custom row source function needed to add arbitrary items to...
18
by: paulwilliamsonremove | last post by:
Hi, I made the move to Access 2003 from Access 97. So far, so great. I am reading a discussion in one of my A2003 developer books. The other has a nice explanation of both but mentions that...
8
by: What-a-Tool | last post by:
I have an array (2 Dimensional) which has been filled from a text file and want to load these several hundred fields into my db, which consists of 3 tables(each of which will be receiving a...
9
by: James | last post by:
So far, is basically dispise ADO.NET & VB.NET. Here's why: Too many confusing ways to do simple things. Here are two examples that maybe someone can help me with: (1) I have TextBox controls...
16
by: ram0812 | last post by:
Helo guys, I am trying to query the MSSQL DB using ADO. I am not able to make the LIKE statement fetch the correct results. Can anyone tell me what I need to do to get this working? Below is the...
3
by: Grumpy Aero Guy | last post by:
Set up a simple ADO.Net Windows app. Set everything up... fill data via ******************************************************************* Dim bmb As BindingManagerBase : : Private Sub...
5
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/adonetprogmsdn.asp The Design of ADO To better understand the model and design of ADO.NET, it is helpful to...
2
by: 09876 | last post by:
Hi: all I understand the difference between dynamic binding and static binding. But I just wonder what is the point to make the distinction between the dynamic binding and static binding. For...
4
by: TonyJ | last post by:
Hello!! I have earlier used ADO.NET 1.1 when working with VS2003.and I'm quite used to that. We have now VS2005 so I can now use ADO.NET 2.0. I just wonder is it great difference working...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.