Re: Moving to next control
- From: "Rob Parker" <NOSPAMrobpparker@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 7 Jun 2006 22:51:44 +1000
You're welcome :-)
Rob
"shanesullaway via AccessMonster.com" <u9936@uwe> wrote in message
news:616a8a92fca64@xxxxxx
Rob,
Thank you, thank you, thank you. You got it doing exactly what I needed
it
to do. I tried so many different ways to get it to do what you did. The
only part I could never figure out was the: Me.Controls(strNextCmdButton).
SetFocus, part. You made my day. Thanks again.
Also, thanks for the information on subs vs functions. I'm new to making
my
own routines and have had a hard time deciding which one to use. With
your
explanation, it will make it much easier to make that decision from now
on.
Thanks again,
Shane
Rob Parker wrote:
Hi Shane,
Sorry about the delay in this thread, but I suspect we're on oppposite
sides
of the world ;)
Well, you're nearly there. What I suggest is:
Set another string variable for the next cmdbutton name
Dim strNextCmdButton as String
In each Case section, assign the appropriate string to this variable, eg.
Case "cmdDetail"
...
strNextCmdButton = "cmdCustomers"
...
Then in your final section, where you are processing the command, you
simply
need
...
If fFormattedMsgBox("No Records To Show!"...)= vbNo Then
'move to the next cmdButton
Me.Controls(strNextCmdButton).SetFocus
Else
...
As a side point, your code can be a subroutine, rather than a function.
The
key difference (in simple terms) is that a function returns a value
(usually - it can be any datatype) when it is called, whereas a subroutine
simply performs an action - as in your code.
Again, HTH,
Rob
Hey Rob,[quoted text clipped - 160 lines]
how
to do one so a little code example would be very helpful.
--
Message posted via http://www.accessmonster.com
.
- References:
- Moving to next control
- From: shanesullaway via AccessMonster.com
- Re: Moving to next control
- From: Rob Parker
- Re: Moving to next control
- From: shanesullaway via AccessMonster.com
- Re: Moving to next control
- From: Rob Parker
- Re: Moving to next control
- From: shanesullaway via AccessMonster.com
- Re: Moving to next control
- From: Rob Parker
- Re: Moving to next control
- From: shanesullaway via AccessMonster.com
- Moving to next control
- Prev by Date: Re: Validating ComboBox Entries
- Next by Date: Re: Listbox: I am stumped!
- Previous by thread: Re: Moving to next control
- Next by thread: Access Report to PDF
- Index(es):