Search code examples
ms-accessvbams-access-2007

Access 2007 field assignmend stopped working


a colleague has a small problem with a value Assignment in Access 2007. The problem is that it stoped working overnight for no obvious reason. It seems to work with Access 2010 when my colleague sent me the Database.

Private Sub BestätigenMieter_Click()
Dim db As Database, AuswahlNr As Integer, datensatz As Recordset

Set db = CurrentDb
Set datensatz = db.OpenRecordset("KostenaufteilungWohnung", DB_OPEN_TABLE)
AuswahlNr = [AuswahlMieter]

'This Line does not work in Access 2007
Forms!MieterProObjekt!UFMieterObjekt.Form![MieterNr] = AuswahlNr

DoCmd.close acForm, "ZuteilungMieter"
DoCmd.GoToControl "LFD"
End Sub

Does anyone see any reason why this should not work. Access doesn't even execute this code in 2007, only when you delete the line it will execute this function.

So any hint why this would not work would be appreacited.

Thanks Lim

---Update----

Thanks to everyone for the input. :) We could not find the problem, although it seems that some of the code in the Database is missing for unknown reasons... this explains at least why it's not working. We requested a backup Version (thats what i should have thought of in the first place :)). I will update or Close if the problem is solved then :)

--Update-- Problem solved, Backup Database is working as intended and nobody knows why :) Thanks for the input and help guys :)


Solution

  • Problem solved with backup Database