none
Why is one of my MainForms locked, stopping me from enter data, until I click any of the SubForms RRS feed

  • Question

  • Hi

    I have tried to find out Why is one of my MainForms locked, stopping me from enter data, until I click any of the SubForms.

    The MainForm is based on one query.

    The MainForm is open by a button and DoCmd.OpenForm "Kundregister", acNormal, """"

    Only one Event procedure - On Close - Me.Filter = False

    I have no idea...


    Cheers // Peter Forss Stockholm


    Tuesday, May 15, 2018 6:31 PM

Answers

  • A workaround is:

    OnLoad goto control [name of subform]

    goto control [fieldname on MainForm]


    Cheers // Peter Forss Stockholm

    Sunday, May 20, 2018 6:40 AM

All replies

  • Hi Peter,

    Are you able to share a copy of the database with test data?

    Tuesday, May 15, 2018 6:44 PM
  • Hello Peter,

    It is hard to troubleshot this issue based on current information. I would suggest share a simply database or detail us the steps how do you create the main form so we could reproduce your issue from scratch.

    Thanks for understanding,

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 16, 2018 5:54 AM
  • Hi DB and Terry

    I will share the database. But first I have to reduce it and remove real customer data etc.

    Please be patient and I will come back


    Cheers // Peter Forss Stockholm

    Wednesday, May 16, 2018 6:22 AM
    1. Your Me.Filter = False should be Me.FilterOn = False
    2. What do you mean by "locked"? "Locked" has a particular meaning for forms and controls. "Locked" is a property setting for controls within any form. If you cannot enter data into your MainForm until you have clicked on one of the Subforms, then make sure there are no macro or code events firing when you enter one of the SubForms.
    3. What error message is given when you attempt to enter data into your MainForm WITHOUT entering a Subform first?
    Wednesday, May 16, 2018 2:42 PM
  • Hi Lawrence

    Thanks for helping.

    1 I changed to Me.FilterOn = False (that didn't solve the issue)

    2 About locked. What I tried to say is that its not possible to enter data in the fields. (When I open the MainForm in design view there are no settings saying I cant enter or edit data)

    I removed every SubForm and all the push buttons. That didnt help.

    3 I dont get any error messages at all.

    To make the MainForm able for new or editing of data I have to click on on SubForm. I just found that clicking any push button also enables new data or editing of data. And finally - strange - see my pic below:


    Cheers // Peter Forss Stockholm


    Thursday, May 17, 2018 5:51 AM
  • Hello ForssPeterNova,

    Could you reproduce the issue using a new form? If you can, please share us your reproduce steps so we could reproduce it from scratch.

    If not, a simply database file(remember removing your sensitive information) will be be greatly appreciated. 

    Thanks for understanding,

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, May 17, 2018 7:17 AM
  • You have given users the ability to enter data into the Customer No. field and Customer Name field in both the Main Form and the SubForm. That's why ACCESS is not allowing data entry on the Main Form. Try the following:

    1. Open the Main Form in Design mode
    2. In the Subform, set the Customer No. field property Visible = No because you already have it on the Main Form. You need it on the SubForm, just not showing.
    3. Remove the Customer Name field from the SubForm because you already have it on the Main Form or at least set its Enabled property = No so users can't enter data into the field on the SubForm.
    4. In the Main Form, select the SubForm and set the SubForms Master/Child property to the 'Customer No' field (because it appears to be common to both forms).

    You don't want users to be able to enter data in the same field on both forms.

    Thursday, May 17, 2018 2:09 PM
  • Hi Terry

    Here is a link to the database.

    I have deleted all the SubForms on the Main. Still having the issue. But I am even more confused now - the three first field kan be edited and if I start with one of those three I can add and edit data in all fields. But if I start with foruth and fifth fields etc they are locked,

    Link to database


    Cheers // Peter Forss Stockholm


    Friday, May 18, 2018 6:03 AM
  • Hi Lawrence

    My picture wasnt good. Its not showing a MainForm and a SubForm. 

    Its a split form, a MainForm splitted with the datasheet to the right.



    Cheers // Peter Forss Stockholm

    Friday, May 18, 2018 6:06 AM
  • A workaround is:

    OnLoad goto control [name of subform]

    goto control [fieldname on MainForm]


    Cheers // Peter Forss Stockholm

    Sunday, May 20, 2018 6:40 AM
  • Hi Lawrence

    My picture wasnt good. Its not showing a MainForm and a SubForm. 

    Its a split form, a MainForm splitted with the datasheet to the right.


    I'm not a great fan of built in features like split forms, which reduce the amount of control I as the developer have over the appearance and functionality.  It's not too difficult to simulate a split form with a conventional parent form and subform, and you'll find an example in FindRecord.zip in my public databases folder at:

    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169

    Note that if you are using an earlier version of Access you might find that the colour of some form objects such as buttons shows incorrectly and you will need to  amend the form design accordingly.  

    If you have difficulty opening the link, copy the link (NB, not the link location) and paste it into your browser's address bar.

    Take a look at the code in the parent form's and the subform's modules to see how the two are synchronized.  Data can be inserted or edited in either.  One thing you'll notice is that there is code in the modules which inserts a new row into a SelectedRecords table.  This table is not relevant to the form/subform in question, but is used by one of the other forms in the demo, which uses the same data as the 'split form'.


    Ken Sheridan, Stafford, England

    Sunday, May 20, 2018 12:26 PM
  • Hi Ken

    Thank you for helping.

    I looked into your "FindRecord" database. Many useful tips and trix there. Thank you for sharing it!

    I have used the bulit in feature Splitt Forms many times, without the kind of issues I now have with one particular form.

    My customers like splitt forms as it is a way to navigate fast and simple when you have reached a big number of records in a table.

    PS.
    I also tested the Allen Browne trick to restore corrupted Forms.
    SaveAsText acForm, "Form1", "C:\MyFolder\Form1.txt"</tt>

    and then

    LoadFromText acForm, "Form1", "C:\MyFolder\Form1.txt"</tt>

    In my case, this time, it didnt help.


    Cheers // Peter Forss Stockholm


    Sunday, May 20, 2018 2:10 PM
  • Peter:

    I don't have your version so I can't open it, so I opened a database that I have that opens a form as a split-form. On my version 2007 form I noticed a form property called Split Form Datasheet. I can set this property to 'Read Only' or 'Allow Edits'. That means I can set the form to allow edits on both the Datasheet and the main form, or only on the main form itself. That is the opposite of what you are experiencing.

    Does your version have a form property that allows editing on the Datasheet side ONLY and NOT on the main form side? You might check.

    Sunday, May 20, 2018 4:08 PM
  • Hi Lawrence

    My version is 2016 32 bit

    I will check Form Properties


    Cheers // Peter Forss Stockholm

    Sunday, May 20, 2018 5:34 PM
  • Here are my Form Properties in a PDF:

    Form Properties pdf


    Cheers // Peter Forss Stockholm

    Monday, May 21, 2018 4:34 AM
  • Hi

    Guess it was as hard for you guys, as for me, to understand why my Form acted like this. I use my workaround until further.


    Cheers // Peter Forss Stockholm

    Sunday, June 3, 2018 2:06 PM