msgbox on close of form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all (sorry if this post appears twice, i already sent a post but it has
not showed up in the group)

I want a msgbox to appear on the close of the form if the following is true,

[status] = "engineered" and [bom] = "0"
or
[status] = "engineered" and [labour] ="0"

the form should stay open until one of the above states changes.

any help appreciated
 
Maax said:
Hello all (sorry if this post appears twice, i already sent a post but it
has
not showed up in the group)

I want a msgbox to appear on the close of the form if the following is
true,

[status] = "engineered" and [bom] = "0"
or
[status] = "engineered" and [labour] ="0"

the form should stay open until one of the above states changes.

any help appreciated

In the Form_Unload event:

If (Me.[status]="engineered") And ((Me.[bom]="0") Or (Me.[labour]="0")) Then
MsgBox "Your message here"
Cancel = True
End If

Carl Rapson
 
Hi Carl, unfortunately the code you supplied does not seem to do anything.
When i click close form the form closes regardless of the status, bom and
labour.
I dont get any messages or errors, just nothing?

Carl Rapson said:
Maax said:
Hello all (sorry if this post appears twice, i already sent a post but it
has
not showed up in the group)

I want a msgbox to appear on the close of the form if the following is
true,

[status] = "engineered" and [bom] = "0"
or
[status] = "engineered" and [labour] ="0"

the form should stay open until one of the above states changes.

any help appreciated

In the Form_Unload event:

If (Me.[status]="engineered") And ((Me.[bom]="0") Or (Me.[labour]="0")) Then
MsgBox "Your message here"
Cancel = True
End If

Carl Rapson
 
If you put a breakpoint in the If... line, do you ever reach it? In other
words, is the Form_Unload event firing? Also, you might try using the names
of the form controls instead of the field names in the If statement.

Carl Rapson

Maax said:
Hi Carl, unfortunately the code you supplied does not seem to do anything.
When i click close form the form closes regardless of the status, bom and
labour.
I dont get any messages or errors, just nothing?

Carl Rapson said:
Maax said:
Hello all (sorry if this post appears twice, i already sent a post but
it
has
not showed up in the group)

I want a msgbox to appear on the close of the form if the following is
true,

[status] = "engineered" and [bom] = "0"
or
[status] = "engineered" and [labour] ="0"

the form should stay open until one of the above states changes.

any help appreciated

In the Form_Unload event:

If (Me.[status]="engineered") And ((Me.[bom]="0") Or (Me.[labour]="0"))
Then
MsgBox "Your message here"
Cancel = True
End If

Carl Rapson
 

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

Back
Top