@pbaldy
Thanks for Your time, my Friend!
I got sth I've created (and it works somehow). Could You look at it, please? I got one more issue about that. I've changed names (deleted spaces and special chars like "/") both in the form and table. To make other things even smoother I made all of areas (texts, choices and formulas) transfering to the table. It may seem very improfessional for You and others, but I'm just a newbie about that, so I decided to do this without functions (that was disaster when I tried anything).
Here is my code. It seems to work somehow.
Code:
Private Sub AktualizujFunkcje_Click()
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Lista")
With rst
rst.AddNew
!Imie_Opiekuna = Me![ImieOpiekuna]
!Nazwisko_Opiekuna = Me![NazwiskoOpiekuna]
!SN_Dowodu_Opiekuna = Me![SNDowoduOpiekuna]
!PESEL_opiekuna = Me![PESELopiekuna]
!Kod_Pocztowy_Opiekuna = Me![KodPocztowyOpiekuna]
!Miasto_Opiekuna = Me![MiastoOpiekuna]
!Ulica_Opiekuna = Me![UlicaOpiekuna]
!Numer_Lokalu_Opiekuna = Me![NumerLokaluOpiekuna]
!imie = Me![imie]
!Nazwisko = Me![Nazwisko]
!tel = Me![tel]
!tel2 = Me![tel2]
!email = Me![email]
!rok_urodzenia = Me![rok_urodzenia]
!SN_dowodu = Me![SN_dowodu]
!numer_umowy = Me![numer_umowy]
!numer_rodzinny = Me![numer_rodzinny]
!okres_wypowiedzenia = Me![okres_wypowiedzenia]
!MS = Me![MS]
!numer_grupy1 = Me![numer_grupy1]
!numer_grupy2 = Me![numer_grupy2]
!numer_grupy3 = Me![numer_grupy3]
!numer_grupy4 = Me![numer_grupy4]
!LP = Me![LP]
!kontakt = Me![kontakt]
!poziom = Me![poziom]
!zainteresowany = Me![zainteresowany]
!uczen = Me![uczen]
!klient = Me![klient]
!niem = Me![niem]
!ang = Me![ang]
!miasto = Me![miasto]
!ulica = Me![ulica]
!numer_lokalu = Me![numer_lokalu]
!kod_pocztowy = Me![kod_pocztowy]
!notatka = Me![notatka]
rst.Update
.Bookmark = .LastModified
.Close
End With
End Sub
I'm not really sure what are those:
Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset
and whether I need You pasted at the end:
Code:
Set db = Nothing
Set rs = Nothing
Could You please explain me (if it's easy to explain) what are those for ?
Frankly speaking, my true problem now is: what if any of my clients change address, get married (changes in last name) or just I make a mistake while inputing data.
The button can only add new record, not edit one.
I've tried to make another button with almost same code, except from: rst.AddNew => rst.Edit. That, of course, does not work as I would like it to.