Toon posts:

[accessXP & VBA] herkennen van een leeg veld in een form

Pagina: 1
Acties:

Verwijderd

Topicstarter
Hoi,

Zit met een volgend probleem:
Ik heb een form met 3 velden:
- new_password
- new_password_confirm
- old_password

Dit form word gebruikt om het wachtwoord te wijzigen van een bepaalde gebruiker. Nu moet er een melding komen als iemand op update drukt en een veld niet is ingevuld.

Ik had voor het veld new_password:
Dim new_password as String

new_password = form!new_password

IF new_password = "" then
<do this>
else
<do that>
end IF

Maar dat werkte niet, iemand enig idee???????

  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

Leeg kan ook null zijn. Check daar ook op.

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.


Verwijderd

Topicstarter
null herkend VBA niet op deze manier:

Dim new_password As String
Dim new_password_confirm As String
Dim old_password As String

If new_password = " " Or new_password = Null Then
MsgBox ("You need to enter a password")
Else
new_password = Form!Password_new_password
new_password_confirm = Form!Password_new_password_confirm
If new_password = new_password_confirm Then
MsgBox ("New password is good")
Else
MsgBox ("New password failed")
End If
End If

Verwijderd

Topicstarter
Ok,
is opgelost met:

If IsNull(Form!Password_new_password) Then

Bedankt.