Subform with RecordSource and Textboxes - Textboxes not editable?

J

juvi

Hallo,

I have got a subform with some textboxes which are fields of the recordsource.
This works fine but I cannot edit any fields through these textboxes.

I checked these properties:
Enabled = True
Locked = False
but it is still not working. Can somebody please help me? Thank you

juvi
 
D

Dirk Goldgar

juvi said:
Hallo,

I have got a subform with some textboxes which are fields of the
recordsource.
This works fine but I cannot edit any fields through these textboxes.

I checked these properties:
Enabled = True
Locked = False
but it is still not working. Can somebody please help me? Thank you


The two things to check first are:

1. Is the subform's recordsource updatable? If it's a query, can you edit
the data in the query if you open it directly?

2. Is the subform set to read-only? (Allow Edits = False/No)
 
J

juvi

My recordsource is updatable (and will be updated in some events by VBA)

Its a query but as you said it can not be edited if I open it directly. What
can I do?

Hmm. My Access is in German but I will try to translate. These options are
set for my subform:

Allow Filter = Yes
Allow Edit = Yes
Allow Delete = Yes
Allow Add = Yes
Allow Data Entry =Yes
Recordsettype = Dynaset
Lock Datasets = No Lock
Get standardvalues = Yes

[OTHER]
Cycle = All Datasets
------------------------------------
Properties for the textbox
------------------------------------
Controlcontent = Anzahl
Enabled = Yes
Locked = No
Filter = Databasestandard

Thank you juvi
 
D

Dirk Goldgar

juvi said:
My recordsource is updatable (and will be updated in some events by VBA)

Its a query but as you said it can not be edited if I open it directly.


The above two statements seem to contradict each other. If you can't edit
the data in your recordsource query when you open it directly, then it is
not updatable.

Maybe I am misunderstanding you, but if that is the case, you should
investigate why the query is not updatable. If you can, post the SQL view
of the query, and we may be able to determine the cause. For example, any
query that uses the GROUP BY, DISTINCT, or UNION keywords is not updatable.
But there aer other possible causes.
 
J

juvi

is it true that Access locks the database if the query contains two tables in
relation? If so then it it will not work with my query. My query has many
problematic definitions like "INNER JOIN", "ON", "ORDER BY"

SELECT tbl_Quotation_Material.Position, tbl_Quotation_Material.Quantity,
tbl_Quotation_Material.MatID, tbl_warehouse.PE, tbl_warehouse.ME FROM
tbl_Quotation_Material INNER JOIN tbl_warehouse ON
tbl_Quotation_Material.MatID=tbl_warehouse.MatID ORDER BY
tbl_Quotation_Material.Position;

How could I make the queries for the subform.recordsource to get this work?
I would just need one textbox (Quantity) editable/updatable. The rest of the
fields are just for information, so the edit textbox should only be the
tb_quantity.

Thank you.
juvi
 
D

Dirk Goldgar

juvi said:
is it true that Access locks the database if the query contains two tables
in
relation?

No, it is not true.
If so then it it will not work with my query. My query has many
problematic definitions like "INNER JOIN", "ON", "ORDER BY"

Those are not problematic.
SELECT tbl_Quotation_Material.Position, tbl_Quotation_Material.Quantity,
tbl_Quotation_Material.MatID, tbl_warehouse.PE, tbl_warehouse.ME FROM
tbl_Quotation_Material INNER JOIN tbl_warehouse ON
tbl_Quotation_Material.MatID=tbl_warehouse.MatID ORDER BY
tbl_Quotation_Material.Position;

That query looks fine, and I see nothing in it that would keep the query
from being updatable. Make sure that both tables have a primary key, and
that there's an index on the MatID field in both tables.

Note: if you reply to this message, I won't be able to respond for about 9
hours.
 
M

MDB2012

Hi Dirk,
I have a very similar problem. A form containing a subform which on open
has the subform controls set enabled = false. On clicking an "Edit" button,
all subform controls are unlocked and enabled.

Both the form and subform have their allowedits = True.
The SQL is similar in structure as "juvi" - straight forward with a JOIN and
an INNER JOIN. All fields joined on are indexed, and all three tables have
primary tables.

Here's the SQL:
SELECT Barcode.PackID, Barcode.DISN, Barcode.Date, Barcode.Time,
Barcode.[H/F], Barcode.SampleID, Barcode.Changed, Barcode.[Manual Entry],
Barcode.[Download Date], [Download ID].DownloadID, Location.Location,
Location.XPLOC
FROM (Location INNER JOIN Barcode ON Location.LocationID = Barcode.Location)
INNER JOIN [Download ID] ON Barcode.[Download Date] = [Download ID].[Download
Date]
ORDER BY Barcode.SampleID;

When you say that all joined fields must be indexed, does it matter what the
name of the indexes are? or whether the index names match?

Thanks,
Marty
 
S

strive4peace

Hi Marty,

"does it matter what the name of the indexes are? or whether the index
names match?"

No, it does not matter

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 
A

Arpeggione

Hi Dirk: I too have a similar problem.....I read Allen Browne's list of why
queries are not editable and I suspect I may have too many joins or they
could be in different directions, but I'm not sure....my SQL is as follows:

SELECT tblDistStations.DistStationID, tblDistStations.StationAbbr,
tblDistStations.StationName, tblDistStations.TransLineID,
tblDistStations.CountyID, tblDistStations.DistrictID,
tblDistStations.SvcAreaID, tblDistStations.Historic,
tblDistStations.DateHistoric, tblDistStations.DateAdded,
tblDistStations.Notes, tblTransLines.[Transmission Line Name],
tblCounties.CountyName, tblDistricts.DistrictName, tblServiceAreas.SvcAreaName

FROM (((tblDistStations LEFT JOIN tblTransLines ON
tblDistStations.TransLineID = tblTransLines.TransLineID) LEFT JOIN
tblCounties ON tblDistStations.CountyID = tblCounties.CountyID) LEFT JOIN
tblDistricts ON tblDistStations.DistrictID = tblDistricts.DistrictID) LEFT
JOIN tblServiceAreas ON tblDistStations.SvcAreaID = tblServiceAreas.SvcAreaID

ORDER BY tblDistStations.StationName;

your thoughts? How can I make this editable? (or anyone else who sees
this....). I did have a simpler query on just two tables, and that worked
fine.

thank you so much! I'll keep searching on the web as well...

Karen
 
A

Arpeggione

Since I have multiple tables and joins, I made sure that output includes the
field on the "many" side of each one-to-many join. My query still is not
editable....

Here is the modified SQL:

SELECT tblDistStations.DistStationID, tblDistStations.StationAbbr,
tblDistStations.StationName, tblTransLines.[Transmission Line Name],
tblCounties.CountyName, tblDistricts.DistrictName,
tblServiceAreas.SvcAreaName, tblDistStations.Historic,
tblDistStations.DateHistoric, tblDistStations.DateAdded,
tblDistStations.Notes, tblDistStations.TransLineID, tblDistStations.CountyID,
tblDistStations.DistrictID, tblDistStations.SvcAreaID
FROM (((tblDistStations LEFT JOIN tblTransLines ON
tblDistStations.TransLineID = tblTransLines.TransLineID) LEFT JOIN
tblCounties ON tblDistStations.CountyID = tblCounties.CountyID) LEFT JOIN
tblDistricts ON tblDistStations.DistrictID = tblDistricts.DistrictID) LEFT
JOIN tblServiceAreas ON tblDistStations.SvcAreaID = tblServiceAreas.SvcAreaID
ORDER BY tblDistStations.StationName;

many thanks to anyone who can help! Karen

Arpeggione said:
Hi Dirk: I too have a similar problem.....I read Allen Browne's list of why
queries are not editable and I suspect I may have too many joins or they
could be in different directions, but I'm not sure....my SQL is as follows:

SELECT tblDistStations.DistStationID, tblDistStations.StationAbbr,
tblDistStations.StationName, tblDistStations.TransLineID,
tblDistStations.CountyID, tblDistStations.DistrictID,
tblDistStations.SvcAreaID, tblDistStations.Historic,
tblDistStations.DateHistoric, tblDistStations.DateAdded,
tblDistStations.Notes, tblTransLines.[Transmission Line Name],
tblCounties.CountyName, tblDistricts.DistrictName, tblServiceAreas.SvcAreaName

FROM (((tblDistStations LEFT JOIN tblTransLines ON
tblDistStations.TransLineID = tblTransLines.TransLineID) LEFT JOIN
tblCounties ON tblDistStations.CountyID = tblCounties.CountyID) LEFT JOIN
tblDistricts ON tblDistStations.DistrictID = tblDistricts.DistrictID) LEFT
JOIN tblServiceAreas ON tblDistStations.SvcAreaID = tblServiceAreas.SvcAreaID

ORDER BY tblDistStations.StationName;

your thoughts? How can I make this editable? (or anyone else who sees
this....). I did have a simpler query on just two tables, and that worked
fine.

thank you so much! I'll keep searching on the web as well...

Karen

Dirk Goldgar said:
No, it is not true.


Those are not problematic.


That query looks fine, and I see nothing in it that would keep the query
from being updatable. Make sure that both tables have a primary key, and
that there's an index on the MatID field in both tables.

Note: if you reply to this message, I won't be able to respond for about 9
hours.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top