Hello
this code does not seem to work, can anyone tell me what's wrong??Code:If Right(Machine, 4) = "nota" Or Right(Machine, 4) = "pers" Then planset!tekst = Right(Machine, 4) End If
Hello
this code does not seem to work, can anyone tell me what's wrong??Code:If Right(Machine, 4) = "nota" Or Right(Machine, 4) = "pers" Then planset!tekst = Right(Machine, 4) End If
Ok I added a few things
and the and not function does not work...
anyone any help thx!!:
Code:If Right(Machine, 4) = "nota" And Not Left(Machine, 4) = "nota" Or Right(Machine, 4) = "pers" And Not Left(Machine, 4) = "pers" Then planset![Machine] = Right(Machine, 4) End If
there is nothing wrong with the syntax. the middle line suggests an update to a table field. if it's not working then the recordset code is in error somewhere in the module, which you have not included here.
The first code is working but this one
Code:If Right(Machine, 4) = "nota" And Not Left(Machine, 4) = "nota" Or Right(Machine, 4) = "pers" And Not Left(Machine, 4) = "pers" Then planset![Machine] = Right(Machine, 4) End If
does not seem to work. I get no errors
How does not it work? Would please give more details? for example, give what data you had in Machine, what do you expected and what did you get?
AND, I think Left(Machine, 4) <> "nota" is easier to read than Not Left(Machine, 4) = "nota"
?
The data in machine is HLnota or HL123nota for example,
I want vba to put "nota" there as tekst instead of HLnota or HL123nota for example. But If the data in Machine is already "nota" I want that this command does not execute???
As what ajetrumpet said, you need to check in other code relative to your recordset.
Please note that you need post update to a recordset to save change to table, an example:
MyRecordset.edit
myRecordset!fieldname="abcdefg"
myRecordset.update