• Form Permissions

    Author
    Topic
    #463168

    I have a Form which displays a listing of partnerships data. When I place a macro button on the form – taking the user to the underlying main record (the macro reads [PSHIPClientCode]=[Forms]![FrmPartnershipListing]![PSHIPClientCode] ) I then cannot save it any more. Then I have to exit the form without saving it. As I now cannot edit it (because it won’t save!) I decided to delete it and use a copy of it. Now I get the attached message. I have looked through the security options, everything is set to Admin. Please point me in the right direction.

    Viewing 20 reply threads
    Author
    Replies
    • #1181235

      This looks like it is probably related to your previous post. Do you have Access User Security active? If so it appears you may have corruption with the security descriptor for forms. If not, then you may not have all the rights you need to have in the Win7 file permissions for your database.

    • #1181240

      Wendell, thanks. Yes this is related to my post about macros and editing forms. Where do I find Access User Security please? I can find Tools / Security

    • #1181257

      If you get a password prompt when you open the first database, then Access User Security is active. But even if you don’t, it is possible for the object permissions in your database to become corrupted so that the Admin user doesn’t have full permissions. Check those with Tools/Security/Permissions.

    • #1181372

      Hi Wendell,
      There is no password on the front end – there are only 2 users anyway. I’m running Office 2003, so Tools / Security / Workgroup Administrator / Create or Join or OK I joined!

    • #1181374

      So, what I really need to knowthen, is how to get rid of this corruption in the front end? Do I delete all the forms and or Queries and start again or other actions please?

      • #1181377

        Try the following:
        – Create a blank new database.
        – Select File | Get external data | Import…
        – Locate the problem database.
        – Import all database objects.
        – Select Tools | Startup… and set the startup options the way you want.
        – If you had set non-default references in the Visual Basic Editor in the problem database, do the same in the new one.

        If Access reports that it cannot import one or more objects, you will either have to recreate those from scratch, or import them from an older backup copy.

    • #1181379

      Thanks Hans, I’ll give that a go, and let the forum know.

    • #1181416

      Hi Hans and all members,
      I created a new databse, imported all the objects from the old one. Many error messages on the forms, none on the queries or reports. On opening the db to the Forms section, all of the forms are displayed… Now I can open a form – the one linked to it throw up an arror message that the Jet engine can’t find that form! After canceling the error messages the form opens and is ready to edit, however any changes made cannot be saved. Can anyone explain what is going on, and would I be better to delete the forms (some / all) ?

      • #1181417

        Strange – usually Access refuses to import an object if it is corrupt.

        Do you have a backup with non-corrupted forms? If not, you will probably have to re-create them…

    • #1182323

      OK, I’ve identified that there were 76 corrupted forms in the database – and am re-building them, a pita, ce la vie. I have created a form called companylist, is displays the company code, name and client status. From here I want to be able to click a button and open the CompanyData form, displaying the same company as had focus on the list. Simple really. I wrote the macro then created a command button and attached the macro to it. I get error message and I can’t fathom our why this is happening. Any help will be appreciated. Pictures attached which show the initial error, Macro 01 and Macro 02 shows the macro itself.

      • #1182325

        One possibility is that the form is in Data Entry mode by default when you open it, so it is trying to create a new record with the same index as an existing record. Debugging macros is a real pain as you don’t have the debug tools that you have in VBA. You might try using the wizard to create a button using VBA and see what you learn doing that.

      • #1182326

        The error message can only occur when a record is being saved. Do you have a macro or VBA code that saves a record when FrmCompanyCodesList is deactivated or when FrmCompanyCode is being opened?

    • #1182329

      Hans, I did have, first the macro opens the data form, then closes the list form – saving in the process. However, when I removed the Close command, leaving just the Open form, I still get the same message, and the macro gets deleted!

      Wendell, I can create the command button with the Open form action and [CodCode] in the list = [CodCode] in the data – that works but leaves the list form still open; I’d prefer it closed.

      • #1182331


        Wendell, I can create the command button with the Open form action and [CodCode] in the list = [CodCode] in the data – that works but leaves the list form still open; I’d prefer it closed.

        That’s easy enough to accomplish – simply add the VBA statement to the procedure the wizard created:
        Me.Close
        or as an alternative:
        Me.Visible=False
        I would still be concerned about the list form thinking the record was dirty however…

    • #1182351

      Unfortunately the command butoon cannot now be created – the error message is that a duplicate key would be created! So I rebuit both the data and the list forms and still the same message. I have checked through all of the forms that I have both Amin and User permissions. This is quite ridiculous really. What shall I try next please?

      • #1182425

        Unfortunately the command butoon cannot now be created – the error message is that a duplicate key would be created! So I rebuit both the data and the list forms and still the same message. I have checked through all of the forms that I have both Amin and User permissions. This is quite ridiculous really. What shall I try next please?

        Well, it seems that something on the form where you are trying to run the macro or code from is attempting to save a new record before the form is closed (or hidden). But to sort that out and see what is really going on will require either an enormous amount of detail to be posted, or you will need to upload a stripped down version of your database with just the key tables and forms. However I believe you indicated previously that would not be possible… So we would need to know everything about your form and the table structure, as well as any class modules in your database.

    • #1184095

      Wendell, thanks for the response. Interestingly I tried building a list form in another (name & address) db and created the macro button taking me from the list to the underlying data form = it works! So there mus be something wrong with my form???
      Please advise what sort of information I can supply, properties of the list form, properties of the data form, screen shot of the query?

    • #1184115

      Weirder & yet weirder. When the command button with the OpenForm command is placed on the FrmList to take you to the FrmData it doesn’t work. So I wrote a macro to do exactly the same thing.
      Saved the macro
      Drew a command button on the FrmList and assigned the macro to it.
      Switched to normal view.
      Clicked on the command button – went straight to the correct record in the FrmData! Yippee.
      Closed FrmData, can see FrmList, no problem as the macro did not have a close command in it.
      Save and close FrmList.
      Re-open FrmList, command button missing
      Re-openmacro – macro missing!

      Any ideas please, as to what the H is going on?

    • #1184131

      Is the form you are using to display the list box bound to the same set of data that you are opening up in the form you are linking too? If that is the case that might explain some of the bizzare behavior you are seeing. Unless there are other reasons to display selected data on the list box form, I would make it completely unbound.

    • #1184323

      Hi Wendell, both forms are based on the same query. So, you can see an abbreviated view in FrmList; then click on the macro button to open the FrmData (where) [RecordId] on the data form equals [RecordId] on the data form.

      • #1184390

        I thought that might be the case, and your form is trying to update the record it is currently attached to. The List form doesn’t have to be linked to the data source for the form – it can be unbound and have the row source for the list as the query that you are using on the form you want to open up. Or are you trying to show some details on the record? In that case you probably want a multi-column list box where the subset of details are displayed. If you use the wizard to build a drop down combo box and see how they implement a similar approach to using a combo box for record navigation, that might shed some light on the situation.

      • #1184397

        Hi
        I’m coming late to this discussion – but I’m wondering what type of form, and what elements are on it.
        I’ve been working with a form with a tabbed control that seems particularly vulnerable to corruption.

    • #1185126

      Wendell, I have copied the db to another directory, so that I can experiment with it. Having deleted all of the macros and forms, I created a single form view of my IndividualData then a continuous list form. The command button to open the data form where [clientcode] = [clientcode] on the list was then created. However it does not work. Ok, you commented that “I would make it completely unbound” Does this mean that the list form does not have a table or qury as it’s source please? In which case how is the list data displayed?

    • #1185255

      Sorry – been tied up most of the day with clients. And what you surmised is true – an unbound form has no data source. However List Boxes (and Combo Boxes) have a Row Source property which can be used to display data. One of the things it can be is a SQL String that is for all intents a query. You must already being doing something like if you are using a list box, but it may need some additional fields if you make your form unbound.

    • #1185628

      Hi Wendell,
      Please do, pardon my ignorance regarding opening forms. Up until a couple of months ago, rightly or wrongly, I was able to open a data form from a list form – both of them having the same data source. Opening the data form never caused an error or exception message. So what’s changed then. I think it must be an Office update? Otherwise it’s Office 2003 inter-reacting with Windows 7. Now don’t get me wrong but there is something weird going on. I thank you for the advice about basing the list form on a SQL Query – I can do this, however it would seem that I have to re-write 50% of my forms then.

    • #1185633

      Wendell, I’ve created a list form, based on a sql query. When I tried to place the command button on the list form I got the previous error message – see attached. The data sources are not the same query. Any thoughts please?

      • #1185807

        Wendell, I’ve created a list form, based on a sql query. When I tried to place the command button on the list form I got the previous error message – see attached. The data sources are not the same query. Any thoughts please?

        That is a different error if i am seeing right, it warns re a duplicate key problem doesn’t it?

    • #1185646

      It appears your attachment didn’t make it. Can you try it again?

    • #1185728

      Attached now – I hope

    • #1185831

      Pat has defined the problem spot on. You can’t save a new record with the same key value.

    Viewing 20 reply threads
    Reply To: Form Permissions

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: