Rabu, 19 Oktober 2011

Re: [MS_AccessPros] How to show a warning msg, when user leaves a form

John,

I wanted to be sure that the incompletely filled in record could in no way by mistake be saved into the database containing null in the critical field, a combo box. I tried around with a few examples, and think the Event property 'Before update' would be the right alternative.
Then however I jumped into next problem: Hoping to test on Null in the combo box, I wrote a piece of code like this:
'If Me!Bransch.Column(1) is Null Then
MsgBox "warning….."
End If
However, executing this line Access shows an error box saying:
'Object is required.'
I have run the code in single step mode and checked that the value of Me!Bransch.Column(1) actually is Null.
What am I doing wrong?
Dennis


19 okt 2011 kl. 15:51 skrev John Viescas:

> Dennis-
>
> Is the form bound? (i.e. has a Record Source)
>
> Please explain what you mean by "leave the form." Close it? Move to another
> record? Put the focus on another form?
>
> John Viescas, author
> Microsoft Office Access 2010 Inside Out
> Microsoft Office Access 2007 Inside Out
> Building Microsoft Access Applications
> Microsoft Office Access 2003 Inside Out
> SQL Queries for Mere Mortals
> http://www.viescas.com/
> (Paris, France)
>
> -----Original Message-----
> From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Dennis Davidsson
> Sent: Wednesday, October 19, 2011 3:47 PM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: [MS_AccessPros] How to show a warning msg, when user leaves a form
>
> Hello,
>
> I want to show a warning message to the user, if he leaves the active form
> without having filled in all boxes properly, because none of the boxes must be
> left with nulls.
> I assume this can be accomplished by issuing a MsgBox statement in some Event
> Property of the form.
> But which is the relevant Event Property to choose for this, so that it covers
> all possible ways of leaving the form?
>
> Regards
> Dennis Davidsson
>
> [Non-text portions of this message have been removed]
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>

[Non-text portions of this message have been removed]

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MS_Access_Professionals/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/MS_Access_Professionals/join
(Yahoo! ID required)

<*> To change settings via email:
MS_Access_Professionals-digest@yahoogroups.com
MS_Access_Professionals-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
MS_Access_Professionals-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Tidak ada komentar:

Posting Komentar