0
votes

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 :)

1
Has your colleague check the references to make sure that none of them are missing? Does a similar reference fail in a fresh database? - Fionnuala
Thanks i will check that, hopefully i can get my hands on the original version tomorrow. - Lim
Any other guesses would still be appreciated :) - Lim
Any more information? "Does not work" covers a multitude. Any error messages? - Fionnuala
That's the thing, there are no Error Messages so far. Access simply does not execute the Click Function. However it does execute it when you remove the: Forms!MieterProObjekt!UFMieterObjekt.Form![MieterNr] = AuswahlNr Line. I would be really happy with an Error Message of any kind :) - Lim

1 Answers

0
votes

Problem solved with backup Database