By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,505 Members | 1,549 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,505 IT Pros & Developers. It's quick & easy.

Formats: Clearing all text-, check and comboboxes except for one box

P: 3
Hi Expert,

I want to clear all fields in a format when I push my clear button except for the textbox ' Date ' which contains the current date as a default value.

I'm using the following code:
Dim ctl As Control

For Each ctl In Me.Section(acDetail).Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox
ctl.Value = Null
Case acCheckBox
ctl.Value = True
End Select
Next
Me.Filter = "(false)"
Me.FilterOn = True

This cleans all fields.

Can you help me out?
Thank you,
Tom
Apr 25 '08 #1
Share this Question
Share on Google+
2 Replies


missinglinq
Expert 2.5K+
P: 3,532
I want to clear all fields in a format when I push my clear button except for the textbox ' Date ' which contains the current date as a default value.
This is somewhat confusing. I assume when you say "all fields in a format" you actually mean all fields in a form.We need a little more information in order to help you. Is your form bound or unbound? And why are you clearing the form? In order to enter a new record, perhaps?

Welcome to bytes!

Linq ;0)>
Apr 25 '08 #2

P: 3
This is somewhat confusing. I assume when you say "all fields in a format" you actually mean all fields in a form.We need a little more information in order to help you. Is your form bound or unbound? And why are you clearing the form? In order to enter a new record, perhaps?

Welcome to bytes!

Linq ;0)>
Hello linq,

indeed, my excuses for the confusion, I mean form. It is indeed for clearing fields to enter a new record.
My form is unbound and I'm using the VB funciton "Date()" as default value but after clearing this field is also blank.

Does this help you?

Thanks,
Tom
Apr 28 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.