it's probably just a typo, but Common is missing an opening double quote - double-check your actual RowSource, just in case this is causing an issue (unlikely!)
When building strings for SQL you will always have to escape whatever character is used as the string delimiter.
Personally I find a pair of single quotes easier to parse mentally than a bank of three or four double quotes! 🤪
Of course, if you are doing any amount of it (building SQL...
Or more concisely still by using a bound form and placing code in the Form's Error event to catch the key violation. You also then no longer need to worry about requerying the form and returning to the same recordset position, delimiting/escaping your inputs etc. etc.
But doesn't allow for...
What you posted is actually incorrect - it is difficult to see because you don't use a monospace font to view it.
dubbel = "Bestelbon = "' & Me.txtBestelbonNew & '"
^ ^ ^
double quote too soon | | missing double |...
It will prevent an error in case anyone types a single apostrophe in txtBestelbonNew.
Yes, you seem to have already found the answer in this other thread.
Why are you asking again? Did it not work?
I think you just mark the whole thread as Solved (Is there a button at the top of the thread?)
I know you have said you are going to use UserForms, but I am attaching the Access version so you can see how simple it is in Access too.
(y)
Make the following changes in your code:
Private Sub passwtxt_Change()
With Me
If Len(Trim$(.passwtxt.Text & vbNullString)) > 0 Then
.passwtxt.BackColor = RGB(255, 255, 204) '&H80000005
Else
.passwtxt.BackColor = RGB(255, 255, 255) '&HC0FFFF
End If...
Yes, there is.
I guess Arnel was using hidden textboxes to demonstrate how it works. (I didn't look at his example)
During the Change event the value in the textbox is 'uncommited' and you must use the .Text property to get the contents. The .Text property is only available when the textbox...