ISNULL one last thing....

I

iam

Private Sub RecipeName_Exit(Cancel As Integer)
If IsNull(Me![RecipeName]) Then
MsgBox "Please enter a Recipe Name."
Cancel = True
RecipeName.SetFocus
End If

Seems to be working in the Application just fine except for one thing.

When I switch from Form View to Design View the Msg Box is coming up
every time. And it takes 2 clicks of the mouse to get rid of it.


A little bit of code causing so many unintended results.
 
J

John Vinson

When I switch from Form View to Design View the Msg Box is coming up
every time. And it takes 2 clicks of the mouse to get rid of it.

Hit <Esc> twice before going into design view to cancel the current
record's update. On going into design view you ARE exiting the
control, so naturally the code will execute.

Users aren't going to be allowed to go into design view surely?

John W. Vinson[MVP]
 
I

iam

Hit <Esc> twice before going into design view to cancel the current
record's update. On going into design view you ARE exiting the
control, so naturally the code will execute.

Users aren't going to be allowed to go into design view surely?

John W. Vinson[MVP]

No, I'm not allowing users to go into design view, it's just annoying
while I jump back and forth between the two views.

I guess I'll comment it out until I'm done with everything else.

Some day I'll marry a programmer girl and she'll have all this fun.
:)
 
L

Lynn Trapp

Some day I'll marry a programmer girl and she'll have all this fun.

Or you might marry and English teacher who will say, "Don't explain how it
works, just make it work."
 
G

George Nicholson

.... or a Manager who wants Psychic programs ("Why can't it just *know* what
I want it to do next, based on my mood, so i don't even have to push the
button?")

Gives new meaning to "artifical intelligence".

(and in no way, shape or form is this gender specific)

--
HTH,

George Nicholson
(Please post responses to newsgroup but remove "Junk" from return address if
used)
 
T

Tim Ferguson

Cancel = True
RecipeName.SetFocus
End If

The call to the .SetFocus method is unneccessary and may be causing your
problems if it causes a recursive call back into the same Exit procedure.
Try removing it (the Cancel=True line is the one that does the work) and
see if one of your message boxes goes away.

All the best


Tim F
 
I

iam

(e-mail address removed) wrote in

The call to the .SetFocus method is unneccessary and may be causing your
problems if it causes a recursive call back into the same Exit procedure.
Try removing it (the Cancel=True line is the one that does the work) and
see if one of your message boxes goes away.

All the best


Tim F
Removing that redundant focus call Cleaned up the code a bit but the
program still works the same. That field is now doing what I want it
to do.

Now if someone will answer my question about changing the gray color
on the subform......datasheet

I have the subform set to Datasheet View and that forces the unused
portion of the SubForm box to a crappy looking Gray color. It
disappears when data items fill up the box but not until then.
 
T

Tim Ferguson

I have the subform set to Datasheet View and that forces the unused
portion of the SubForm box to a crappy looking Gray color. It
disappears when data items fill up the box but not until then.

Sounds like a Windows Control Panel setting: look in the Display Settings
and the Window Background colour (that's from memory, but it should be
somewhere around there).

HTH


Tim F
 

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

Similar Threads


Top