Advertisement

06.03.2008 at 09:38PM PDT, ID: 23455583
[x]
Attachment Details

Microsoft Access, 2003 editable recordset

Asked by ceelly in Access Coding/Macros, Access Forms

Tags: Microsoft Access, 2003, VB, VB

Hi,

I am trying to write some code for a form with pull down combobox and a subform in Access 2003.  The subform is a datasheet. The pull down combobox contains a list of groups and the datasheet contains items  belong to  the selected group from the combobox.

The code creates a recordset based on the value selected from the combobox and assigns the recordset to the datasheet in the subform.  However the recordset is not editable so the user can not add to the recordset.  Is there anyway to make the recordset editable??? or is there a simpler way to do this???

cheers

CeellyStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
Private Sub Combo2_Change()
Dim SiteList As String
Dim sql As String
Dim rs As Recordset
 
Set subform = Forms("SiteLists").Sites
 
SiteList = Combo2.Value
sql = "SELECT dbo_Site.Site_ID, dbo_Site.Name " & _
"FROM dbo_Site" & _
", SiteListNames, SiteLists " & _
"WHERE dbo_Site.Site_ID = SiteLists.Site " & _
"And SiteLists.SiteList = SiteListNames.SiteList " & _
"And SiteListNames.Name = '" & SiteList & "'"
 
Set rs = CurrentDb.OpenRecordset(sql, dbOpenDynaset)
 
'rs.Edit
'the above line produces an error message
'Cannnot update. Database or object is read only
 
Set subform.Form.Recordset = rs
 
 
subform.Form.Visible = True
 
End Sub
[+][-]06.03.2008 at 11:52PM PDT, ID: 21707501

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Access Forms
Tags: Microsoft Access, 2003, VB, VB
Sign Up Now!
Solution Provided By: frankytee
Participating Experts: 1
Solution Grade: B
 
 
[+][-]06.03.2008 at 11:56PM PDT, ID: 21707523

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 12:10AM PDT, ID: 21707572

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 09:00PM PDT, ID: 21716286

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 07:07PM PDT, ID: 21765716

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628