J jpl458 Well-known member Local time Today, 07:57 Joined Mar 30, 2012 Messages 1,198 Oct 27, 2022 #1 Is there a way to clear all the dat entry text boxes on a form without having to address each one?
P plog Banishment Pending Local time Today, 09:57 Joined May 11, 2011 Messages 12,061 Oct 27, 2022 #2 No, there is no Me.ClearAllTextBoxes(), but you can make one. You can loop through all the controls of a form with by using Me. Controls, then you can use the .ControlType to see if its a acTextBox and if so you can then clear it.
No, there is no Me.ClearAllTextBoxes(), but you can make one. You can loop through all the controls of a form with by using Me. Controls, then you can use the .ControlType to see if its a acTextBox and if so you can then clear it.
Ranman256 Well-known member Local time Today, 10:57 Joined Apr 9, 2015 Messages 4,352 Oct 27, 2022 #3 Code: sub ClearAllTextBoxes() dim ctl as control for each ctl in controls if Typename(ctl) = "TextBox" then ctl.value = "" next end sub
Code: sub ClearAllTextBoxes() dim ctl as control for each ctl in controls if Typename(ctl) = "TextBox" then ctl.value = "" next end sub
J jpl458 Well-known member Local time Today, 07:57 Joined Mar 30, 2012 Messages 1,198 Oct 27, 2022 #4 Ranman256 said: Code: sub ClearAllTextBoxes() dim ctl as control for each ctl in controls if Typename(ctl) = "TextBox" then ctl.value = "" next end sub Click to expand... How about Me.Requery. That seems to work.
Ranman256 said: Code: sub ClearAllTextBoxes() dim ctl as control for each ctl in controls if Typename(ctl) = "TextBox" then ctl.value = "" next end sub Click to expand... How about Me.Requery. That seems to work.
theDBguy I’m here to help Staff member Local time Today, 07:57 Joined Oct 29, 2018 Messages 22,781 Oct 27, 2022 #5 jpl458 said: How about Me.Requery. That seems to work. Click to expand... Is your form bound or unbound?
jpl458 said: How about Me.Requery. That seems to work. Click to expand... Is your form bound or unbound?
J jpl458 Well-known member Local time Today, 07:57 Joined Mar 30, 2012 Messages 1,198 Oct 27, 2022 #6 theDBguy said: Is your form bound or unbound? Click to expand... Bound
theDBguy I’m here to help Staff member Local time Today, 07:57 Joined Oct 29, 2018 Messages 22,781 Oct 27, 2022 #7 jpl458 said: Bound Click to expand... Is the Data Entry property set to Yes?
J jpl458 Well-known member Local time Today, 07:57 Joined Mar 30, 2012 Messages 1,198 Oct 27, 2022 #8 Data Entry set to Yes
theDBguy I’m here to help Staff member Local time Today, 07:57 Joined Oct 29, 2018 Messages 22,781 Oct 27, 2022 #9 jpl458 said: Data Entry set to Yes Click to expand... You could try something like this too. Code: DoCmd.GoToRecord , , acNewRec Hope that helps...
jpl458 said: Data Entry set to Yes Click to expand... You could try something like this too. Code: DoCmd.GoToRecord , , acNewRec Hope that helps...