Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

clear tab control with subforms

Status
Not open for further replies.

Saphyre88

Programmer
Nov 19, 2006
3
CA
Hi,

what is the best way to clear data from multiple subforms of a tab control at once ?

The tab control is updatable on a change of a list box. However, when a second listbox is updated, all the information should be cleared from all tabs. ???

Thanks
 
Cleared as in:
- a new record for data entry;
[tt] Docmd.GotoRecord ...[/tt]
- a blank screen;
[tt] Me.[Subform Control Name].FormAllowAdditions=False
Me.[Subform Control Name].Form.RecordSource = _
"Select * From tblTable Where 1=2"[/tt]
- or empty the current controls?
[tt] You will probably wish to add other control types
or perhaps use the tag property to mark controls
to test. You may also wish to test for several data
types.[/tt]
Code:
For Each ctl In Me.Controls
   If ctl.ControlType=acTextBox Then
     Me(ctl.Name) = Null 
   End If
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top