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

Same events for similar controls

P: n/a
I want to validate data in inputboxes, checking the format . I have 4
similar fields. I'd like to use the same validation routines.

It doesn't look like Access (2003) can have control arrays, as in VB of
old. So I tried to pass my textbox as a parameter to a common routine:

myValidationRoutine(mytextbox)

where mytextbox is the name of the input box, and

sub myValidationRoutine(tb as textbox)
...
end sub

the definition of the sub. I get a runtime complaint on an incorrect
parameter.

What must I do, to be able to use common routines for my 4 textboxes?

--
Bart.
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Bart Lateur wrote:
I want to validate data in inputboxes, checking the format . I have 4
similar fields. I'd like to use the same validation routines.

It doesn't look like Access (2003) can have control arrays, as in VB
of old. So I tried to pass my textbox as a parameter to a common
routine:

myValidationRoutine(mytextbox)

where mytextbox is the name of the input box, and

sub myValidationRoutine(tb as textbox)
...
end sub

the definition of the sub. I get a runtime complaint on an incorrect
parameter.

What must I do, to be able to use common routines for my 4 textboxes?


Me.ActiveControl

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

P: n/a
Try declaring your argument as Control, rather than as Textbox.

"Bart Lateur" <ba*********@pandora.be> wrote in message
news:no********************************@4ax.com...
I want to validate data in inputboxes, checking the format . I have 4
similar fields. I'd like to use the same validation routines.

It doesn't look like Access (2003) can have control arrays, as in VB of
old. So I tried to pass my textbox as a parameter to a common routine:

myValidationRoutine(mytextbox)

where mytextbox is the name of the input box, and

sub myValidationRoutine(tb as textbox)
...
end sub

the definition of the sub. I get a runtime complaint on an incorrect
parameter.

What must I do, to be able to use common routines for my 4 textboxes?

--
Bart.

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.