Topics Search

Clear Subform and Form with Command

Clear Subform and Form with Command
Views: 144
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.
 

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?
 

Using strLink operator for Subform

Using strLink operator for Subform Icon
I have a form that uses the strLink operator, under a command button, that open a small form, used to auto-sort records based on whatever fields the user want to select. Works great, however I have the need to split my form into a main & subform format.

For formatting and space limitations, I wouldl like to keep the command button on the main form. I have tried a couple different method of changing the strLink command line to try and put focus on the subform. I have tried:

strLink = "frmSub" and strLink = Forms!MainForm!frmSub

but neither have obviously worked. I keep getting a form cannot be located error. I search the site for "strLink" threads but there was no help available.
 

Export Subform Results

Export Subform Results Icon
Address, etc). In that form is a subform linked together by customer number which shows product detail for that customer.

I have a command button that allows people to access this subform. What I need is to create a command button that will take those results and export to excel. I know how to create a macroto link to that subform, but it does not filter by customer, it exports all results in the subform.