Topics Search

How to clear the form?

How to clear the form?
Views: 112
Is there some who can help how to clear a form? A form is empty and you need to find the record first. For example a log in form with your username and password. You don't want your username and password to be displayed if someone wants to open your database so you need to clear out and let that person type the username and password. Because in the table you add your username and password. The problem is that when I try to run the form base on the logintable, it displays the username and the password automatically. How could I clear the form making it empty? Please need
Sponsored Links:

More topics

 

Clear a form without gettingerrors

Preview
Using a form to edit detail in a subform in Access 2003. When the users open the form; the fields are populated with previous data. The form has a recordsource of a table and the subform has a recordsource of a query.

The users select invoice number from a unbound field on the main form which loads applicable data in the subform. I put a clear button on the main form to clear the fields but it gives me errors about how I can't change the record because it would cause duplicates.

How do I clear the fields when the users exit the form without gettingerrors.
 

How to clear form without setting DataEntry property to yes

Preview
I would like to clear the data displayed in a subform with VBA using a button, similar to when you have the DataEntry property set to NO, and then has to close and open a specific form, to clear it.

In short, the data will be displayed in form until you clear it with a button - (dataentry will be yes, till you press the clear button)

My reason for doing this - when I temporarily close the main form and return later, all data captured are deleted from the subform, and I then have to check what was the last data captured, before continuing with the next lot. This wastes time.

the main form is "StocktakeF"
the subform is called : "Fis_stocktakeSF"
 

Operation to Clear a Form?

Preview
I have a form that uses a query to run reports. Is there an operation for a button to clear the form? When it starts the wizard there is no option for clearing the data, just refreshing. They are all unbound combo boxes that I have in the form.

I don't need to save any records as this form is used solely for reporting purposes.
 

Error when clearing form

Preview
Using access 2007

Basically I have created a form (Majority unbound) and wanted the user to be able to save the form (done) and then clear the form in order to input the new data.

I already have a clear button that clears a majority of the controls on the form using this VBA code

Private Sub Clear_form_Click()
Dim ctl As Control

On Error Resume Next

For Each ctl In Me.Controls
ctl.Value = ctl.DefaultValue
Next

Set ctl = Nothing

End Sub

This is all well except one point :

The last text box doesn't clear, instead it says #Error. The Text box is simple I just created it from the MS ribbon and entered the name of it and a simple calculation which is : =[Quantity]-[Quantity_out].

this obviously means that not all the controls are clear and new so How exactly do I over come this?

Anything else I can do please ask
 

How to make cmd buttons (undo & clear) work on subforms

Preview
On the Main form I have cmd buttons that clear and undo.

Specifically the Undo doesn't undo the subforms, just the Main form. I also am not sure how to make my clear button, clear out all controls on all 3 forms.
 

Trying to clear my unbound form with an onClick event. Partially working

Preview
And it works fine to clear my combo boxes. I changed a few things to try to get it to clear a couple text boxes on the form as well. however my improvisation did not work.
:-----
Private Sub cmdClearCombos_Click()
' Resets ALL combobox values in the current form to null.

Dim ctl As Control

For Each ctl In Me.Controls
If TypeOf ctl Is ComboBox Then
ctl.Value = Null

End If
Next

End Sub

-----

I tried adding another IF/Then after that one to clear TextBox, got errors.

Then I tried to add an OR, such as "If typeof ctl is ComboBox or TextBox Then" this also didn't work, although it did still clear my combo boxes and didn't error.
 

Clear form help needed

Preview
I am looking for some help via macro or some type of code I can attach to a button on a form so it would clear text / combo boxes on the form. There are some very novice users that use the database and the form has some data validation rules so they at times will get stuck when they have entered a wrong number.

I am trying to add a button that if they get confused willclear the for for them and they can start over.
 

Deselect all checkboxes in Access 2007 form

Preview
I have created a split-form (Form_ChkBx)to display records in my table (MST_Table). The bottom portion of the split-form has datasheet view, the top portion has two control buttons, "Clear" & "Exit".

I would like to program the "Clear" button to loop through the form or table and deselect (clear or reset) all checkboxes.
 

Records remaining on the form

Preview
When I fill out the form and click the button to add the record, it works fine. However, when I exit the form or access completely and then go back into the form, the last values that were enter show up on the form/screen.

If I delete each field to clear the screen, it also deletes it from the table. This also happens when I go to my search form.

How do I prevent this from occurring. If the screen automatically clears, it will also delete from the table ? In the search form, I have a clear search button that clears all the search values in the form header, but not the detail.

Again, if I clear the detail, will it delete the record from the table ? And how do I prevent the search form from being edited once data isdisplayed ?

I am almost there but these are minor quirks that I cannot figure out.
 

how to clear highlighted fields with a command button

Preview
I have multiple fields in a form that use a macro event to highlight the backcolor of the field when the data is changed. I would like to be able to clear the highlighted fields with the click of a button.

I have a command button programed to save the record and would like it to clear the highlights for me as well. What is the best way to accomplish this goal?