If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Clear contents of an unbound text box on a bound form.
I would like to clear the contents of an unbound text box in access 2003. I
have several unbound text boxes that I enter numbers and then press a command button that runs a macro to add them up and enter the total into a bound field (like a calculator). I also have a command button that goes to a new record. I need to clear the contents of the unbound boxes when I goto the new record. -- Dave K. |
#2
|
|||
|
|||
Clear contents of an unbound text box on a bound form.
Do you mean a new record or a different record or both ?
In the On Current event of the form you can put this code Me.TextBox1 = "" Me.TextBox2 = "" etc. if you only want to clear thjem on a new record then put an if around the lines If Me.NewRecord = True Then Me.TextBox1 = "" Me.TextBox2 = "" etc. End If "Dave K." wrote: I would like to clear the contents of an unbound text box in access 2003. I have several unbound text boxes that I enter numbers and then press a command button that runs a macro to add them up and enter the total into a bound field (like a calculator). I also have a command button that goes to a new record. I need to clear the contents of the unbound boxes when I goto the new record. -- Dave K. |
#3
|
|||
|
|||
Clear contents of an unbound text box on a bound form.
Thanks I actual just just put in the command button for a new record and It
works fine. Private Sub AddRecord_Click() On Error GoTo Err_AddRecord_Click DoCmd.GoToRecord , , acNewRec Me.Check1 = 0 Me.Check2 = 0 Me.Check3 = 0 Me.Check4 = 0 Me.Check5 = 0 DoCmd.GoToControl "date" Exit_AddRecord_Click: Exit Sub Err_AddRecord_Click: MsgBox Err.Description Resume Exit_AddRecord_Click End Sub -- Dave K. "RonaldoOneNil" wrote: Do you mean a new record or a different record or both ? In the On Current event of the form you can put this code Me.TextBox1 = "" Me.TextBox2 = "" etc. if you only want to clear thjem on a new record then put an if around the lines If Me.NewRecord = True Then Me.TextBox1 = "" Me.TextBox2 = "" etc. End If "Dave K." wrote: I would like to clear the contents of an unbound text box in access 2003. I have several unbound text boxes that I enter numbers and then press a command button that runs a macro to add them up and enter the total into a bound field (like a calculator). I also have a command button that goes to a new record. I need to clear the contents of the unbound boxes when I goto the new record. -- Dave K. |
Thread Tools | |
Display Modes | |
|
|