Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating recordset property in runtime form becomes non editable

Status
Not open for further replies.

Kalyan Ganesan

Programmer
May 10, 2017
93
US
The recordset type i have is Dynaset (Inconsistent Updates)

I am updating the recordset in runtime thru below code

Dim strSelect As String
Dim rs1 As DAO.Recordset


strSelect = "SELECT * FROM MAIN"

Set rs1 = CurrentDb.OpenRecordset(strSelect)
Set Me![subform].Recordset = rs1
Set rs1 = Nothing


it works but the controls in the subform become non editable, if i dont update the recordset in runtime and use LinkedMasterfields then the controls are editable

what property do i need to set to make the form editable

I am attaching the property sheet of the subform in the image


 
 http://files.engineering.com/getfile.aspx?folder=285003ba-3abc-48b6-8fd6-c246146d4a8f&file=Untitled.jpg
If you simply open the record source as datasheet can you edit records? What is the SQL property of the query?

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
You didn't answer either of my two questions. I think I saw your SQL from another thread but I'm not sure.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Yes when i open the subform as a datasheet alone i am able to edit the records,did i answer your question,and the recordsource for that is a query that is set in property sheet and the query has two tables joined
 
Is this the SQL of the query and if so, LOAN_NUMBER a primary key in one or both tables?

Code:
strSelect = "SELECT MAIN.*, MSP_DATA.LAST_PAYMENT_MADE, MSP_DATA.NEXT_PAYMENT_DUE_DATE, MSP_DATA.CURRENT_UPB, MSP_DATA.PROP_VALUE, MSP_DATA.BORROWER_NAME, MSP_DATA.TOTAL_MONTHLY_PAYMENT, MSP_DATA.INVESTOR_ID, MSP_DATA.PROPERTY_ALPHA_STATE_CODE, MSP_DATA.INVESTOR_NAME, MAIN.MULTI_LIEN, MAIN.SECOND_LIEN, MAIN.THIRD_LIEN"
strSelect = strSelect & " FROM MAIN LEFT JOIN MSP_DATA ON MAIN.LOAN_NUMBER = MSP_DATA.LOAN_NUMBER WHERE MAIN.GOLD_NUMBER='" & cmbGoldNumber.Text & "';"

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Yes thats the query but i have a different module in the same project which uses a similar query but that fetches way more data

this query above fetches like 500 rows

but the idea is the same
 
I would create a test.

[ul]
[li]Take the query used in the subform and use it as the record source in a new form. Does it allow editing?[/li]
[li]Add this new form as a subform of another new form. Does it allow editing?[/li]
[/ul]

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top