Clear Button

Nov 15, 2006

i have a form that allows to add details to the table "tab_main".

ive got a clear button, it clears all textboxes apart from the textbox "date_issued". i get the following error message:

'Run-time error '2113':

The value you entered isn't valid for this field.'

Why am i getting this?

ive checked the table field and im inputting the right value!

in the command button under EVENT PROCEDURE, im using following code:


Private Sub Command25_Click()

Dim intResponse As Integer

intResponse = MsgBox("Are you sure you want to clear the text Boxs", vbYesNo, Change)

If intResponse = 6 Then
Me.number.Value = " "
Me.username.Value = " "
Me.cost_centre.Value = " "
Me.phone_model.Value = " "
Me.imei.Value = " "
Me.sim_no.Value = " "
Me.puk_code.Value = " "
Me.date_issued.Value = " "

Else

End If

End Sub

Help me!!!! thanks

View Replies


ADVERTISEMENT

Clear Button On A Form

Jun 12, 2006

I'm trying to create a search form with drop down boxes to select criteria.

I would like a "Clear Form" button that removes any data on the form to start a new search with. I have the following command in an "on click" event. But when I use this, it does clear the form. But from then on out, I get no results from my form. Even submitting the form with every entry blank, I get no results, when I know I have data in the form. I verified with my tables that the data in them didn't get deleted by using the code to clear the form.

Private Sub ClearForm_Click()

Me.[cmbNCTool].Value = ""
Me.[cmbNCDivision].Value = ""
Me.[cmbToolMaterial].Value = ""
Me.[cmbProfile].Value = ""
Me.[cmbToolType].Value = ""
Me.[cmbProfileType].Value = ""
Me.[cmbBoardThick].Value = ""
Me.[cmbMinorD].Value = ""
Me.[cmbShankD].Value = ""
Me.[cmbMaxCut].Value = ""
Me.[txtNotes].Value = ""
Me.[txtDesc].Value = ""
Me.[chkUsedArksCtyVeneer].Value = ""
Me.[chkUsedCorbinFoil].Value = ""
Me.[chkUsedFFallsVeneer].Value = ""
Me.[chkUsedFFallsFoil].Value = ""
Me.[chkUsedVbrgVeneer].Value = ""
Me.[chkUsedVbrgWood].Value = ""

End Sub

From what I know, this should only clear my form, not cause it to mess with results after it's used to clear the form once. I've even deleted this line of code from my database itself and I still get 0 responses back when I search.

Any ideas what I'm doing wrong, or is there a better way to clear a form with a button to click on?

Thanks for any help you can provide.

View 2 Replies View Related

Command Button To Clear

Jul 14, 2006

I have a command button (cmbBarcodeEnter). After update i want the it clear itself of text and the be ready for the next barcode to be entered. At the moment the button updates and then tabs to next button and leaves the text in the cmbBarcodeEnter button.

Thanks
D

View 2 Replies View Related

How To Create A Clear Button

May 10, 2012

I need creating a clear form button in access....

View 1 Replies View Related

Using A Command Button To Clear A Checkbox

Apr 27, 2005

Dear all:

I have a form with names, addresses, student ID number, etc. In addition there is a checkbox called "Graduated".

Is there a way to use a command button to clear ALL of the students who have been checked?

Many thanks in advance.

Regards,

Dion

View 2 Replies View Related

Modules & VBA :: CMD Button To Clear A Table Column

Mar 26, 2015

I'm currently making an Experience Statement for my company. In one of the forms I've created I an Industry sort that is weighted and connected to a table so that it'll show a report based on the numbers provided IE. 1-5 One being shown first and a blank statement not showing on the report at all.

I have the report function working correctly the only thing I would like is a cmd button that clears sort table of numbers so that it doesn't show anything and can start fresh. What VBA code shall I use?

I was thinking something along the lines of this, but it's not working.

Dim s as String
s = "UPDATE All_Projects_Sort_Table SET Industry Sort = Null;"
CurrentDb.Execute s
Requery

Attached are some images ...

View 2 Replies View Related

Forms :: Creating A Clear / Refresh Button

Dec 29, 2014

Using Access 2013.I have a Search Form with a Run Query button. I would like to add a button that clears the criteria entered into the search text boxes. Right now to change the criteria I have to manually delete everything entered, closed the current query it had open then go from there. I have tried using the command button wizard, form operations, then refresh form data. When I click that button a window pops up "The command or action 'refresh' isnt available right now".Is this not the correct way to set up what I need? What other options should I look into for setting this up?

View 1 Replies View Related

Forms :: Clear Fields In Form And From Table With A Button

Mar 10, 2015

I want to be able to clear all the contents in my fields (which are bound to my table) with a click of a button

View 1 Replies View Related

Forms :: Possible To Clear Filters Set On Subform Using Button On Main Form?

Jan 12, 2014

Is it possible to clear filters set on a subform using a button on the main form?

View 1 Replies View Related

How To Create Reset Button That Can Clear Text Box In Search Form

Jul 12, 2012

i already built reset button with this code but it is not working. i'm use this code;

Private Sub clearbtn_Click()
Me!qproject1 = " "
Me!qdoc1 = " "
Me!qvolume1 = " "
Me!qbox1 = " "
End Sub

it's any error in this code..??

View 2 Replies View Related

Clear A Combo Box

Jan 13, 2006

what's the best way of clearing the contents of a combo box? i don't want to change the row source, just make it blank as though a selection has not been made.

i have two unrelated combo boxes on a form; there will probably be more later. when i pick a value from one i want the other(s) to clear.

on the after update event of each combo i've tried clearing the contents of the other combo with these:

- me.othercombo = null
- me.othercombo = 0
- me.othercombo = ""
- me.othercombo.value = ...
- me.othercombo.undo
- etc.

'= null' clears the other combo.
'= 0' also clears the other combo.

but i think i'm missing something here. each combo also has a cmdbutton that will take the user to another form based on the selection made.

if i use '= 0', the other combo clears but its cmdbutton still works. even if the combo appears to be empty its associated cmdbutton still opens the next form (it should produce a msgbox asking the user to make a selection).

'= null' clears the combo and its cmdbutton produces the appropriate message to make a selection. so that's what i'm using right now. is this the best way? can something = null?

View 3 Replies View Related

What Is Best Way To Clear Tables?

Apr 2, 2007

I need to b able to clear records from 3 tables with one click

I tried opening each as a record set and looping through deleting each in turn with a loop, however this I know to be poor practice and it also errors as i cannot delete a record that is part of a relationship.

is there a more suitable way to do this?

View 9 Replies View Related

Clear All Values Except N/A

Feb 10, 2008

Hi:

I have a table setup to enter dates for each person that requires safety quizes for the month those that don't have an "N/A" for the month by thier names.

Each year I have to start over and it is a real pain to manualy delete all the dates for each person for Jan through December.
I only want the dates gone not the name or the N/A values.

Is there a sub or query that will search each record and only delete the dates?

Thanks
Charles

View 14 Replies View Related

Clear A Listbox???

Feb 21, 2005

I'm using access 2003, and for some stupid reason they decided to remove the "clear" method from listboxes... In previous access version I could clear a listbox using "listbox.clear", but now I have no idea. Does anyone know a good way to clear listboxes in Access 2003.

View 4 Replies View Related

Clear A Form

Apr 12, 2005

Hey all,

I have some code that looks like this to control a form;

Private Sub btnAdd_Click()
Dim UserName As String
Dim Initials As String
Dim Password As String
Dim OutlookName As String
Dim rst As DAO.Recordset

'Check each control, is their a value? if not, set focus to control
If IsNull(txtUserName) Then
MsgBox "You did not enter a new UserName nobby!"
Me!txtUserName.SetFocus
Exit Sub

ElseIf IsNull(txtInitials) Then ' return value of UserName variable;
MsgBox "You have not entered any initials for user: '" & Me!txtUserName & "'"
Me!txtInitials.SetFocus
Exit Sub

ElseIf IsNull(txtPassword) Then
MsgBox "You must create a password for user: '" & Me!txtUserName & "'"
Me!txtPassword.SetFocus
Exit Sub

ElseIf IsNull(txtOutlookName) Then
MsgBox "You must enter a Outlook name for: '" & Me!txtUserName & "'"
Me!txtOutlookName.SetFocus
Exit Sub

End If
' Pass the variables to the table.
Set rst = CurrentDb.OpenRecordset(("Users"), dbOpenDynaset, [dbSeeChanges])
With rst
.AddNew
![User] = Me!txtUserName
![Password] = Me!txtPassword
![Initials] = Me!txtInitials
![OutlookName] = Me!txtOutlookName
![Level] = 1
![Select] = 0
![dummy] = Null
.Update
.Close
Set rst = Nothing
End With
DoCmd.Close
End Sub

Private Sub btnCancel_Click()
' Confirm Cancellation Box
If MsgBox("Are you sure you want to quit?", vbYesNo, "Caution") = vbYes Then
DoCmd.Close
Else
DoCmd.CancelEvent
End If

End Sub

What I really want to do is once the update has occured is set a label I have as hidden, to show and to clear all the controls.

View 5 Replies View Related

Clear The Form

Jun 5, 2005

Thanks,
Now I can populate text fields by selecting any one of the combo box selection.

But I need to clear the form to insert next record. Currently I am inserting record by using Save_cmd button. I can insert second record but couldnot clear all the fields after inserting automatically. So I am doing clear all the fields manually or overwriting values.

If there is anyone pl. help me.

Thanks

View 2 Replies View Related

Clear Up Value On Next Record

Feb 16, 2006

Hi everyone

I have a part of the form with the following fields

Title
Name
Address1
Address2
Area
...

Address2(street) field is a drop downbox, once selected the area text field will be automatically shown
what I got in AfterUpdate event on Street is as below
Me.txtArea = [cboAddress2].[Column](2)

the problem with this is, even when I move to another record the Area field doesn't clear up which is still using the old Area info that has been selected before,

I belive I have to have some Clear Up function on somewhere, not sure exactly where and what Code will clear up the value,

Can anyone help please!!

Thanks in advance
Si

View 1 Replies View Related

Clear Form

May 5, 2006

Hello,

I would like to put a button on a form I am making so that you can clear it without saving the data.

eg you open the form input a load of data, it is all wrong so you click clear form and start inputting data again

I have the button what do i need to do to get it to do this

Thanks

Chris

View 4 Replies View Related

Clear Form

Mar 7, 2006

I have a SQL Database that is housing my tables
I have an Access Front end that is Allowing users to view and edit the data residing on the SQL Database.

I have write/modify rights on the database and as such I wrote the code , OnLoad of Form, to Automatically set the Form to "Add Record", thus clearing all the TextBoxes and ComboBoxes. That works alright.

My problem is when a user without write/modify rights opens the Form I am getting an Error "Cannot go to specified Record". If I understand this right this is happening because they do not have suffeciant rights.

How Can I get a form to load and display all the textboxes and ComboBoxes BLANK....this only way I can think of is to set the form to Add Record.

ANY THOUGHTS

View 2 Replies View Related

HELP ! How To Clear A Filter ..................

Jun 14, 2006

hi,

How do I clear a filter ? When I re-open a form that is based on a stored parameter query, I get a message about "apply/filter that cannot be applied..."

So, as a result, I put in some code for that command button that closes the form, then reopens it, and I get my prompt from the query. Isnt there a way to clear the filter without closing the form? It looks funny to me and I know the users will have a cow. I sure appreciate any ideas.Im digging around to see what I can do quickly, but I cant find anything that works. thanks a lot!

View 3 Replies View Related

Clear On RecordsetChange

Jul 19, 2006

Private sub Form_DatasetChange()
Text28.Text.Clear
End Sub

I am wanting to move between records but when I return to the records I have just moved from I want to clear some of the text boxes. This code is not working though. Any suggestions

View 2 Replies View Related

Clear List Box?

Feb 28, 2007

Where is the ListBox.Clear option??????

How can I clear the entire ListBox?

View 4 Replies View Related

Clear Out A Table To Add New Records

Jan 31, 2006

I have a transfertext macro that imports my text file into a table but the table already has data in it so it is not importing and losing all the records. What do i do to clear out the table before i import in.. Can i use another macro ???

View 1 Replies View Related

Clear Login UserName

Jul 18, 2006

Hi all,

I've had a quick search but couldn't find the answer to this.

Is there a way that when a user launches the application via my workgroup file, the default login name is always null?

Currently it retains the last users' login name.

Thanks
Kempes

View 6 Replies View Related

Clear Range Of Data

Jul 12, 2005

Is it possible to clear the cotents from various records but only the values in one column. Like let's say I just want the delete the values in the Price column for a range of about 6000 records. Not the whole records just those price values.

I can't seem to find a way to do this without sitting there and pushing down and backspace over and over again.

thanks,
joëlle

View 1 Replies View Related

A Way To Clear The Tables In The Database...

Jul 19, 2006

Thanks for considering my question. I have developed a DB with about 60 tables, all related by one-to-many relationships. During development, I placed values in the tables, generated keys, etc. so things have gotten quite cluttered. Is there a way (vb program, access method, etc.) that I can use to remove all the entries from the table, and essentially start with a set of clean tables and no keys? I'd like to be able to run this from a control on a form.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved