Clear all text boxes on tab page

T

Tom

Using Access 2002 we have a form containg a 6 page tab control.

When the user clicks an edit button they are taken to the 3rd page of that
control. That control has 18 unbound text boxes.

What is best practise to clear those 18 text boxes when that tab page
becomes the active page.

Thanks in advance for any advice

Tom
 
T

tina

Private Sub TabCtl0_Change()

With Me
If !TabCtl0 = 2 Then
!Text5 = Null
!Text7 = Null
!Text9 = Null
End If
End With

End Sub

in the above example, the code is running on the tab control's Change
event.the name of my tab control is TabCtl0. the number 2 is the value of my
tab control page's PageIndex property; the value is different for each page
in the tab control, and tells the tab control which page you just moved to.
Text5, Text7, and Text9 are the names of three unbound textbox controls on
my tab page.

hth
 
M

Marshall Barton

Tom said:
Using Access 2002 we have a form containg a 6 page tab control.

When the user clicks an edit button they are taken to the 3rd page of that
control. That control has 18 unbound text boxes.

What is best practise to clear those 18 text boxes when that tab page
becomes the active page.


You should be able to use code like:

For Each ctl In Me.tabcontrol.Pages(2).Controls
If ctl.ControlType = acTextBox Then
ctl.Value = Null
End If
Next ctl
 
W

Wasim Yasin via AccessMonster.com

How can I create a 4 or > 4 tab form. I tried with toolkit box but it
create ony 3 tabs form.

waiting for an early reply.
 
T

Tom

Wasim

If you right click on yourtab control a sub menu comes up. Select Insert
page from that menu


Tom
 
W

Wasim Yasin via AccessMonster.com

Thanks Tom.
I'm beginner for access. now i'm working to make a Form. I need help more
than times. If all of u don't mind than please contact me thru mail for
early replies.
My address is wasim_sono[AT]Hotmail[DOT]Com
 
T

tina

usually help is requested and received here in the public forum, rather than
via email, in order to benefit everybody. as a beginner, you can help
yourself a lot if you have a good basic Access manual to learn the basics.
if you don't have one already, one good text is Microsoft Access <version>
Bible by Prague and Irwin. it teaches a good set of basic skills that you
can then build on to expand your abilities. you'll find a list of websites
offering other Access books at
http://www.ltcomputerdesigns.com/JCReferences.html#Books

hth
 
W

Wasim Yasin via AccessMonster.com

Tina
Thanks a lot for reffering books. I hope i'll complete my project.
Here a new problem that i want to solve now.
I had a table having field 'Date' with 'Medium date' property.I don't know
how user enter something that now some records show date as '12-dec-1899'
but in table when i click the field the text converted to '00:00:09'. When
i run an update query to change the contents of '12-Dec-1899' it results '
(0) rows updated.
Any help is appreciated.
 
W

Wasim Yasin via AccessMonster.com

Tina
Thanks a lot for reffering books. I hope i'll complete my project.
Here a new problem that i want to solve now.
I had a table having field 'Date' with 'Medium date' property.I don't know
how user enter something that now some records show date as '12-dec-1899'
but in table when i click the field the text converted to '00:00:09'. When
i run an update query to change the contents of '12-Dec-1899' it results '
(0) rows updated.
Any help is appreciated.
 
T

tina

i'm afraid you've stumped me with this question, Wasim. suggest you post
your question in the microsoft.public.access.tablesdbdesign newsgroup, where
it will get fresh attention from the very skilled folks that hang out in
that newsgroup. good luck.
 
M

Marshall Barton

Wasim said:
I had a table having field 'Date' with 'Medium date' property.I don't know
how user enter something that now some records show date as '12-dec-1899'
but in table when i click the field the text converted to '00:00:09'. When
i run an update query to change the contents of '12-Dec-1899' it results '
(0) rows updated.


A date/time value is stored as a double with the integer
part being the number of days since 30 Dec 1899 and the
fractional part being the fraction of a day (e.g. noon is
..5).

This means you could interpret 12 Dec 1899 as -18 with a
very small fractional part to account for the 00:00:09 time.

In other words, either the user entered a garbage value or
your field is not a date/time field and Access garbled the
conversion to a date/time value. (An example of the latter
is if the field is a Single or Double and you assigned
12/12/2005. After the divisions has a value of
..000498753117206983, which will convert to a date/time as
30 Dec 1899 00:00:43)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top