473,414 Members | 1,947 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,414 software developers and data experts.

Field is based on an expression that can't be edited

MNC
I am using Access2002

I have the following code run when a form opens, and the form won't let me
edit the recordset.

The form and the controls are not locked, edit is allowed, Recordset Type is
'Dynaset'

Any thoughts?
Private Sub Form_Load()
Dim frm As New Form
Dim test As Boolean
Set frm = Me
test = SQLFunctions.BindForm(frm, "DSN=test;uid=admin;pwd=", _
"SELECT LName FROM tblMemberInfo")
Set frm = Nothing
End Sub
Function BindForm(frm As Form, cnConn As String, cmdtext As String) As
Boolean
Dim rstMember As New Recordset
Dim Found As Boolean
Dim i As Integer
Dim cntConn1 As New Connection
Dim cmd As New Command
Dim cntl As Control
Dim fld As Field
'Specify the connect string
cntConn1.ConnectionString = cnConn
'Open the connection
cntConn1.Open

'Specify the SQL statement
cmd.ActiveConnection = cntConn1
cmd.CommandText = cmdtext
'Open the recordset
rstMember.CursorLocation = adUseClient
rstMember.Open cmd, , adOpenStatic, , adCmdText

'set the form's recordset to the returned recordset

Set frm.Recordset = rstMember

'Bind the returned fields to the controls having the same
'name as the field
For Each fld In rstMember.Fields
For Each cntl In frm.Controls
If cntl.Name = fld.Name Then
cntl.ControlSource = fld.Name
End If
Next
Next

'close and destroy the objects used for querying

rstMember.Close
cntConn1.Close

Set rstMember = Nothing
Set cntConn1 = Nothing
Set cmd = Nothing
GetRecords = True

End Function
Nov 12 '05 #1
0 1485

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Lando Chez | last post by:
Hi I want to create fileds on my form that can not be manually edited through the UI of the form. Instead the (visible) content is changed through changes on other parts of the form. e.g....
1
by: Dalan | last post by:
I apparently need some assistance with Access 97 regarding the changing of a value in a field through use of a check box. I have a subform (sfrmDocList) with a column for indicating if a document...
2
by: Galina | last post by:
Hello I have an application in MS Access 2000. I have a form, which includes a subform. The subform is based on a table, but locked for any editing. There is Edit button. When clicked, it starts a...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
2
by: Randy A. Bohannon | last post by:
This is probably a simple thing to do, but I can't find how in the help files or the manual I have. I'm using Access 2000. I have three tables joined by a common field, and I'm using one form...
2
by: Uwe Range | last post by:
Hi to all, I am working on a form with a combi-field on a subform. I want to give the user the opportunity to alter the list-content (which is based on a table) in a separate form. The user...
3
by: skinnybloke | last post by:
Hi - I have the following VB function within MS Access which is called via a query. How do I modify this code so that it will only do the replacement based upon the value of another field on the...
5
by: rdemyan via AccessMonster.com | last post by:
I have a need to add another field to all of my tables (over 150). Not data, but an actual field. Can I code this somehow. So the code presumabley would loop through all the tables, open each...
5
by: CSmith | last post by:
I have a calculated field in a query, it calculates the # of days an employee has been employed using the following statement =datediff("d", , NOW()) by default. When an employee is terminated, I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.