30. oktober 2014 - 12:16Der er
8 kommentarer og 1 løsning
Run-time error '2046' Kommandoen ......
Min model består af X antal frontend databaser og 1 backend database. X brugere taster oplysninger til backend på samme tid ( typisk 2-3 brugere ) hvilket for det meste går udemærket, men af og til får en bruger denne meddelelse :
Run-time error '2046' Kommandoen eller handlingen 'Kopier' er ikke tilgængelig nu.
Den pågældende bruger kan ikke arbejde videre før den pågældende database er genstartet ....
Frontend består af en hovedform og en subform, hvorfra al databehandling foregår.
Via hovedform fremsøger en bruger en record som vises i subform. Denne record skal herefter kopieres som ny record i databasen med ny unik ID ( autonum ).
Dette gøres ved hjælp af en funktionsknap på hovedform ved hjælp af følggende :
Private Sub CopyRecord_Click() Dim db As DAO.Database
I think the problem is related to the sub-table being activated.
The method used is this :
1. A record is found using the search function in the main form 2. This record is visualized in the subform 3. Using the copy function, a new record is added 4. Via this new record, a subtable is maintained
As a part of the search ( 1. ) the functionality marks/highlights the rocord to be copied.
If a user chose to close the subtable after maintaining the content, step 1-4 runs smoothly
If a user chooses to leace the subtable open/active it fails because the search function doesn't mark/highlight the correct record for copying :-(
In other words, I'm missing af function ( BeforeUpdate ) to close the subtable before a new search in performed !!!
Not sure I understand fully. I assume you have separate tables for the main form and sub form
You find a record in the main form and then copy the record to the sub form (separate table)
You say "If a user chooses to leace the subtable open/active .." I assume you mean the sub form?
Is the sub form a separate form (not a sub form of the main form)?
You say " If a user chooses to leace the subtable open/active it fails because the search function doesn't mark/highlight the correct record for copying :-("
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.