Hi ,
i am very new to Access, do not understand VB and would like to ask for your help.
Since some time now, i am learning and working on a Database (first “mdb” and later “adp”) for the accounting of my brothers small company.
In one form i am calculating the sum of several fields which come from several functions. The problem is, that if one field has no value, i can not do the calculation at all. Before i had one solution for one field using the if-function, but actually i have some more fields, which could end up with no value. Do i have to use the if-function to work around all those fields or is there another way?
I searched in this forum, but i do not really understand if the “Nz”-function will help here and how i could use it.
Although my code is quite a shame, i dare to paste it. Maybe, someone care to take a look?
Private Sub ErgebnisTextfeld_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (Forms!frmBilanz!frmBSfrmfunDarlehen!Darlehen > 0) Then
Forms!frmBilanz!ErgebnisTextfeld = Forms!frmBilanz!frmBSfrmBankKasse!BAnfangsstand – Forms!frmBilanz!frmBSfrmfunVerbindlichkeiten!Gesamtkosten – Forms!frmBilanz!frmBSfrmfunBankanKasse!BankanKasse + Forms!frmBilanz!frmBSfrmfunForderungen!Gesamtpreis + Forms!frmBilanz!frmBSfrmfunDarlehen!Darlehen
Else
Forms!frmBilanz!ErgebnisTextfeld = Forms!frmBilanz!frmBSfrmBankKasse!BAnfangsstand – Forms!frmBilanz!frmBSfrmfunVerbindlichkeiten!Gesamtkosten – Forms!frmBilanz!frmBSfrmfunBankanKasse!BankanKasse + Forms!frmBilanz!frmBSfrmfunForderungen!Gesamtpreis
End If
End Sub
I am very sorry for my ugly code and long form names, it was more like an accident, that i actually have some code at all. And sorry again, for i do not know how to change the code, so it is not that unreadable long. : (
Dankesch