0
votes

I have weird issue, code that was working suddenly started to generate an issue (i have no clue how to bypass it)

I have List Box (List2) on Form1, It's populated by:

SELECT [queryFormyTradycyjne].[Nr Maszyny], [queryFormyTradycyjne].[UID], [queryFormyTradycyjne].[Nazwa], [queryFormyTradycyjne].[UAP], [queryFormyTradycyjne].[Linia], [queryFormyTradycyjne].[GAP], [queryFormyTradycyjne].[Status] FROM queryFormyTradycyjne ORDER BY [Nr Maszyny]; 

queryFormyTradycyjne code:

SELECT Lista.[Nr Maszyny], Lista.[Nazwa], Lista.[UAP], Lista.[Linia], Lista.[GAP], Lista.[Status], Lista.[UID]
FROM Lista
WHERE Lista.isValid=False And Lista.UID Like 'FF*';

and if I'll double click on an item from List2 it supose to deliver value to the other form (AwariaZgloszenieNew), to the text field named txtNrMaszyny.

THAT was working just fine, since 2 hours ago. I actually didnt touch a thing in the code nor in any of these forms. I checked that on several PC's with different Access version installed. Same result: Error Method 'Item' of object 'Forms' failed (-2146500594 (800f000e))

My VBA code for double click event:

Public strSelectedItem As String

Private Sub List2_DblClick(Cancel As Integer)
Dim varItem As Variant

With Me.List2
    For Each varItem In .ItemsSelected
    strSelectedItem = .ItemData(varItem)
    Next
End With

DoCmd.OpenForm "AwariaZgloszenieNew"

[Forms]![AwariaZgloszenieNew].[txtNrMaszyny] = strSelectedItem

End Sub

Anyone with any kind of idea?

1
Have you tried a compact and repair on the DB?MatthewD
Im not quite sure how to do that. Edit: if u r talking about that button "Compact and repair" - after clicking it nothing changed...Eska
On database tools tab of the ribbon menu there is a "Compact and repair Database" button. Back up your database first.MatthewD
Suddenly my front end to the database it ~3mb, comparing to the backup of it i have - 40~mb. What just happened? :| Backup is kinda old..Eska
That's normal, it's the "Compact" part of "Compact and repair".Andre

1 Answers

1
votes

If "Compact and repair" doesn't help, there are two more things you can try.

  • Decompile

How does one decompile and recompile a database application?
Follow the steps in David-W-Fenton's answer to the letter.

  • Create a new database and import all objects from the old one.

Edit -- just saw your latest comment.
If the VBA code is gone, and no working backup available, some parts may be lost. For the future: during development, "Compact and repair" and (to a lesser extent) Decompile should be regular tasks.

I don't know how Decompile works with password protected code.
IMHO a better option to protect code in Access is by distributing .mde frontends instead of .mdb