So you set the tempvar to a null value,as Me.txtpermission had no value?
Walk through the code LINE BY LINE with F8 and hover over the variables to see what they contain.
So you set the tempvar to a null value,as Me.txtpermission had no value?
Walk through the code LINE BY LINE with F8 and hover over the variables to see what they contain.
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
@Welshgasman Thanks I'll give that a go this evening but got to go out now. Thanks for all the help
Ignore this post
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
I may be missing it but where are you setting the value of Me.txtPermission?
I would expect to seeCode:me.txtPermission = ab.Permission
If this helped, please click the star * at the bottom left and add to my reputation- Thanks
integers and strings can't contain Null.You can also use the Nz function to replace Null with an empty string if referred to as a string, or 0 if referred to as an integer.
You could try
1: If Me.txtPermission.Value is a string
2: If Me.txtPermission.Value is a numberCode:if nz(Me.txtPermission.Value,"") ="" then msgbox "txtPermission has no value" else TempVars.Add "UserPermission", Me.txtPermission.Value MsgBox TempVars![UserPermission] end if
Code:if nz(Me.txtPermission.Value,0) =0 then msgbox "txtPermission has no value" else TempVars.Add "UserPermission", Me.txtPermission.Value MsgBox TempVars![UserPermission] end if
Using combinations of all help/suggestions, I have now got this sorted. Thanks
Good stuff. Members are here to help.