Topics Search

Clear Subform and Form with Command

Clear Subform and Form with Command
Views: 142
I have a form (frmCashSales) and I have a subform which is continuous (sfrmSalesDetails) on that form. What happens is when a product is selected and added to an order it goes from a drop down on the form into a line in the subform, users can enter as many products as they like, but when they complete the order, I would like the form and subform both to be cleared so a neworder can be started.
Sponsored Links:

Similar posts...

 

Clear a form without gettingerrors

Clear a form without gettingerrors Icon
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

How to clear form without setting DataEntry property to yes Icon
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"
 

How to change the properties of a command button on a subform

How to change the properties of a command button on a subform Icon
I have a form with a subform in a tab control. on the subform I have command buttons (Add, View, Delete) the properties of these commands is set to Enabled = No.

When I click a command button on the form (Unlock) I want it to make the command buttons on the subform to become enabled.

How do I go about changing the properties of a command button on a subform?
 

how to clear highlighted fields with a command button

how to clear highlighted fields with a command button Icon
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?
 

Subforms on form

Subforms on form Icon
The database I have created has a large subform on it, which is a table for me to enter in information for that record, but I'm having problems with it.

When I open the form I add data to the form and subform, but when I click the button for a new record it makes a new one and clears the writing so I can fill out the new record. But it does not do it for the subform.

How can I do it so that when I click new record it will clear the data on the form and subform, so that when I switch through the records then the data will change showing the correct information in the subform?
 

Preview Report Command That Can Do More

Preview Report Command That Can Do More Icon
Access 2010 - I have a search form where end users enter parameters. I used the command wizard and created a preview report command button so the report tab comes up in preview mode just fine.

I also created a Clear Entry command button that works. However if I leave the report open in preview mode and go back to the form tab, hit the Clear Entry button, then enter new parameters, the report data doesn't change from the previous entry.

1. Will the end user have to close the report manually each time before entering new parameters?

2. If not, where is the Close Report command button? I could only find Close Form.

3. What's the code to create a command button to refresh the report?

4. Finally, can everything (preview report, clear entry, refresh data) be done using just 1 command button? Can't I add the code I need behind one command?
 

Command button to close and return to original form

Command button to close and return to original form Icon
I have a subform with a command button that will return the user to the main form. However, the subform remains open. I'd like the command button to also close the subform on click.
 

Form/Subform Command Button & Links

Form/Subform Command Button & Links Icon
I have a form that I would like to keep in "Continuous Form" view but also need a subform of sorts that can be opened with a DblClick or Command Button. I know technically you don't "open" a subform - it's linked to the parent table, however Access doesn't allow for the insertion of a subform if your parent form is in continuous view.

Is there a snippet of code that can open a form and define it as a child form and link master/child fields? Or any other method of opening a form with a command button and have it linked to the parent table by a PK field
 

Use command button to change recordsource in subform?

Use command button to change recordsource in subform? Icon
I have some queries that run when I click the command buttons. But, they open in a new window. I want them to open up in the subform that I put in the Parent form. How can I get it to workso when I click on the command button and instead of a new window it will populate my subform?
 

How to requery main form before opening subform.

How to requery main form before opening subform. Icon
I have a main form and a subform. The subform displays fields also visible in the main form such as 'Name'. When I click a button on the main form it opens this subform. The problem is this:

Everything works fine with existing records, but when I click a button on the main form, to open up the subform, the Name field in the subform is blank, unlike that of the main form, which has just been filled in. Both forms are linked to the same 'name' field in an underlying table.

So I suspect, filling in the 'name' field in the main form, only updates the underlying table upon closing the main form (or changing the record?). What I want it to do is to update the main table as soon as the name text box has been filled in, in the main form. I hope this is clear