Re: Go to Control with IIf statement
- From: "Al Campagna" <alcampagna@msnewsgroups>
- Date: Thu, 22 Mar 2007 12:51:53 -0400
Adriana,
It woulkd have been helpful had you given a bit more detail, like the name of the
combo, the values in the combo, the names of the fields you want to go to, and what
selection goes to what field, and your Macro actions.
I never use macros... but I don't think Macros has an IFF action, so that's a problem
to start with.
Use an Event Procedure that triggers on the AfterUpdate event of your combo (ex.
cboSomeChoice)
(use your own object names)
Private Sub cboSomeChoice_AfterUpdate()
If cboSomeChoice = "X" Then
MsgBox "Must fill in Field1", vbOKOnly
Me.Field1.SetFocus
Else
MsgBox "Must fill in Field2", vbOKOnly
Me.Field2.SetFocus
End If
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions
"Find a job that you love, and you'll never work a day in your life."
"Adriana" <Adriana@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CE743852-ECA1-4C1F-9D47-02DE43345932@xxxxxxxxxxxxxxxx
I would like to have a condition on a form control that will set the focus to
another control on the form. I have a drop down box in a form based on a
Category table and if that selection is one of two choices, then I need a
message box to tell them to fill in another control and a GoTo control to set
the focus to the other field. So far, I built a macro and assigned the macro
to the After Update event of the actual control. It works, however, no
matter which category is picked, the MsgBox pops up and sets focus to the
other field even though I only want two specific categories.
.
- Prev by Date: Re: Look up a week number
- Next by Date: Re: subform with 2 child/masterfields but one with expression?
- Previous by thread: Re: how to requery an entire form ?
- Next by thread: Re: Go to Control with IIf statement
- Index(es):
Relevant Pages
|
Loading