I'm usingto clear a text box and it works fine.Code:Me.txtExcludeItem.Value = Null
I tried this also and it does not work, wondering why?
Code:Dim idVar As String idVar = Me.txtExcludeItem idVar.Value = null (also tried idVar = null)
I'm usingto clear a text box and it works fine.Code:Me.txtExcludeItem.Value = Null
I tried this also and it does not work, wondering why?
Code:Dim idVar As String idVar = Me.txtExcludeItem idVar.Value = null (also tried idVar = null)
Because idVar holds a string which is the value in txtExcludeItem, not the control itself. String does not have properties.
If you want an object variable then need to declare as Object and Set it. But why bother? What are you really trying to accomplish?
Dim idVar As Object
Set idVar = Me.txtExcludeItem
idVar = Null
Could do the following with string variable:
Dim idVar As String
idVar = Me.txtExcludeItem.Name
Me(idVar) = Null
Me.Controls(idVar) = Null
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Ah ok.
I don't need to do it that way, I was just playing around with code trying to understand.
This is clearing my text box after the event happened (saving the value to a table or clearing if the value did not pass validation)