Datasheet mode form for both data entry and data retrieval

here4real

Registered User.
Local time
Today, 11:35
Joined
May 1, 2013
Messages
87
I want to use the same form in datasheet mode for data entry and retrieval. When retrieving, all controls are disabled and locked. I am trying to enable and unlock them for modifying but that isn't working. What am I doing wrong?

<code>
DoCmd.OpenForm "PO_Practice Data", , , , acFormEdit, acHidden

Forms![PO_Practice Data]!PO_Name.Enabled = True
Forms![PO_Practice Data]!PO_Name.Locked = False
Forms![PO_Practice Data]!Practice_Name.Enabled = True
Forms![PO_Practice Data]!Practice_Name.Locked = False

DoCmd.Close acForm, "PO_Practice Data"

DoCmd.OpenForm "PO_Practice Data", acFormDS, , , acFormEdit, , "Write"

Forms![PO_Practice Data]!PO_Name.Enabled = False
Forms![PO_Practice Data]!PO_Name.Locked = True
Forms![PO_Practice Data]!Practice_Name.Enabled = False
Forms![PO_Practice Data]!Practice_Name.Locked = True

<code>
 
Your code, as presented, opens a form, fiddles with it, closes it, and then opens it again. Did you expect your fiddles to be permanent?
 
I guess I thought that when you change the enabled and/or locked values that they did carry over. I presume from your answer that this is not the case?
 
I ended up changing it to a continuous form. Too many restrictions on datasheet mode.
 

Users who are viewing this thread

Back
Top Bottom