1
votes

In my form I have a subform, which displays A, B, C. Then information C is displayed in textbox. User should have a possibility to modify this data in order to modify data in database.

I am able to display information C in text box based on this subform. However it is uneditable, it is written: "Control can't be edited; it's bound to the expression".

It seems to me, that it is impossible to edit data because it is taken not directly from database but from sub form, so I make special query which takes data directly from database however I lose an event which is based on selecting proper record from subform (there is only onEnter and onExit events)

Is it possible to make such things?

3
Does the data table exist in MS Access, is it a linked table, or is the data coming from a query? - Lisa
subform is made from query based on existing in MS Access tables. - galvanize
If the answer below doesn't solve your problem, check out additional reasons why your recordset might not be updateable: rogersaccessblog.blogspot.com/2009/11/… - Lisa

3 Answers

1
votes

You can add a second subform to contain the C text box. Link the second subform to the first with the underlying table's primary key.

That's the easiest alternative I can think of to make the text box editable.

0
votes

If you're using a recordset to populate or modify anything, then make sure you are using the .Edit and .Update to modify an existing cell in a row.

Dim myR as Recordset

Set myR = CurrentDb.OpenRecordset("Table_Name_Here", dbOpenDynaset)

'use a .FindFirst method to find the row you want to modify
'or modify the Recordset to pull a SELECT statement instead of the whole table

myR.Edit
myR![Field_to_edit] = Forms![main form name]![subform control name].Form![control name]
myR.Update

Set myR = Nothing
0
votes