Simple MsgBox question

  • Thread starter Johnnie_on_the_Spot
  • Start date
J

Johnnie_on_the_Spot

I am trying to set up a MsgBox function in a form I have designed for the
management of contracts. However, I am having trouble getting it to return
the message in the way I need it too. The database has over 50 contracts with
numerous pieces of information on each. One of which is the expiration date
of the contract. While scrolling through all contracts, I need MsgBox to
return the message "expired contract" whenever the expired contract is pulled
up regardless whether the expiration date field is highlighted or not. I am
using a simple macro ([Expiration Date]<Date())and it returns the appropriate
message if the expiration date feild is highlighted or if i move the mouse
near the feild. I have been expirimenting with the properties area to try and
get this to happen by but have now given up and am asking for some help.
Thank you for you time and please let me know if I can offer any additional
info needed to solve this problem.
 
J

Johnnie_on_the_Spot

Is there any way to get a MsgBox pop up simply when scrolling through froms?
It would be nice if the pop up happened automatically without any action
other than scrolling or clicking onto the form. otherwise the alert is not
that valuable to me.

MikeJohnB said:
The link below allows you to download a demo zip file which set mouse over
events, Button text changes as you move the mouse over them. It is
accomplished with VBA code though but you might be able to work that out.

http://www.datastrat.com/Download/MouseMove.zip


hth? Mike B
--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you have tried all,
you have shouted at and blamed the innocent,
and asked everyone you know,

READ THE INSTRUCTION MANUAL.


Johnnie_on_the_Spot said:
I am trying to set up a MsgBox function in a form I have designed for the
management of contracts. However, I am having trouble getting it to return
the message in the way I need it too. The database has over 50 contracts with
numerous pieces of information on each. One of which is the expiration date
of the contract. While scrolling through all contracts, I need MsgBox to
return the message "expired contract" whenever the expired contract is pulled
up regardless whether the expiration date field is highlighted or not. I am
using a simple macro ([Expiration Date]<Date())and it returns the appropriate
message if the expiration date feild is highlighted or if i move the mouse
near the feild. I have been expirimenting with the properties area to try and
get this to happen by but have now given up and am asking for some help.
Thank you for you time and please let me know if I can offer any additional
info needed to solve this problem.
[/QUOTE]
 
J

Johnnie_on_the_Spot

Oh by the way that is a dead link

MikeJohnB said:
The link below allows you to download a demo zip file which set mouse over
events, Button text changes as you move the mouse over them. It is
accomplished with VBA code though but you might be able to work that out.

http://www.datastrat.com/Download/MouseMove.zip


hth? Mike B
--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you have tried all,
you have shouted at and blamed the innocent,
and asked everyone you know,

READ THE INSTRUCTION MANUAL.


Johnnie_on_the_Spot said:
I am trying to set up a MsgBox function in a form I have designed for the
management of contracts. However, I am having trouble getting it to return
the message in the way I need it too. The database has over 50 contracts with
numerous pieces of information on each. One of which is the expiration date
of the contract. While scrolling through all contracts, I need MsgBox to
return the message "expired contract" whenever the expired contract is pulled
up regardless whether the expiration date field is highlighted or not. I am
using a simple macro ([Expiration Date]<Date())and it returns the appropriate
message if the expiration date feild is highlighted or if i move the mouse
near the feild. I have been expirimenting with the properties area to try and
get this to happen by but have now given up and am asking for some help.
Thank you for you time and please let me know if I can offer any additional
info needed to solve this problem.
[/QUOTE]
 
M

MikeJohnB

Sorry about the link, it was there the other day, I down loaded the programme.

How are you allowing the user to navigate the form? Just an idea, you could
hide the navigation buttons and make your own buttons using the wizard for
record navigation.

Goto First Record |<
Goto Previous Record <
Goto Next Record >
Goto Last Record >|

You can then enter your code in the on click event of Each Button as follows

'Code for Next record shown but the same If, then msgbox end if code applies
Private Sub Command16_Click()
On Error GoTo Err_Command16_Click


DoCmd.GoToRecord , , acNext
If Me.Expiration Date < Date Then
MsgBox "Expired"
End If

Exit_Command16_Click:
Exit Sub

Err_Command16_Click:
MsgBox Err.Description
Resume Exit_Command16_Click

End Sub

'Because you have a gap in the control name you may have to enclose
[Expiration Date] in Brackets


This way, which ever way the user scrolls up or down the records, a msgbox
will display.

hth helps, will try some other methods and let you know

Mike B
--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you have tried all,
you have shouted at and blamed the innocent,
and asked everyone you know,

READ THE INSTRUCTION MANUAL.


Johnnie_on_the_Spot said:
Oh by the way that is a dead link

MikeJohnB said:
The link below allows you to download a demo zip file which set mouse over
events, Button text changes as you move the mouse over them. It is
accomplished with VBA code though but you might be able to work that out.

http://www.datastrat.com/Download/MouseMove.zip


hth? Mike B
--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you have tried all,
you have shouted at and blamed the innocent,
and asked everyone you know,

READ THE INSTRUCTION MANUAL.


Johnnie_on_the_Spot said:
I am trying to set up a MsgBox function in a form I have designed for the
management of contracts. However, I am having trouble getting it to return
the message in the way I need it too. The database has over 50 contracts with
numerous pieces of information on each. One of which is the expiration date
of the contract. While scrolling through all contracts, I need MsgBox to
return the message "expired contract" whenever the expired contract is pulled
up regardless whether the expiration date field is highlighted or not. I am
using a simple macro ([Expiration Date]<Date())and it returns the appropriate
message if the expiration date feild is highlighted or if i move the mouse
near the feild. I have been expirimenting with the properties area to try and
get this to happen by but have now given up and am asking for some help.
Thank you for you time and please let me know if I can offer any additional
info needed to solve this problem.
[/QUOTE]
 
D

Douglas J. Steele

It's not a dead link. MikeJohnB should have only posted
http://www.datastrat.com/Download/MouseMove.zip (It comes from
http://www.datastrat.com/Download2.html at Arvin Meyer's site)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Johnnie_on_the_Spot said:
Oh by the way that is a dead link

MikeJohnB said:
The link below allows you to download a demo zip file which set mouse
over
events, Button text changes as you move the mouse over them. It is
accomplished with VBA code though but you might be able to work that out.

http://www.datastrat.com/Download/MouseMove.zip


hth? Mike B
--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you have tried all,
you have shouted at and blamed the innocent,
and asked everyone you know,

READ THE INSTRUCTION MANUAL.


Johnnie_on_the_Spot said:
I am trying to set up a MsgBox function in a form I have designed for
the
management of contracts. However, I am having trouble getting it to
return
the message in the way I need it too. The database has over 50
contracts with
numerous pieces of information on each. One of which is the expiration
date
of the contract. While scrolling through all contracts, I need MsgBox
to
return the message "expired contract" whenever the expired contract is
pulled
up regardless whether the expiration date field is highlighted or not.
I am
using a simple macro ([Expiration Date]<Date())and it returns the
appropriate
message if the expiration date feild is highlighted or if i move the
mouse
near the feild. I have been expirimenting with the properties area to
try and
get this to happen by but have now given up and am asking for some
help.
Thank you for you time and please let me know if I can offer any
additional
info needed to solve this problem.
[/QUOTE]
 
J

Johnnie_on_the_Spot

Thanks I got it working

MikeJohnB said:
Sorry about the link, it was there the other day, I down loaded the programme.

How are you allowing the user to navigate the form? Just an idea, you could
hide the navigation buttons and make your own buttons using the wizard for
record navigation.

Goto First Record |<
Goto Previous Record <
Goto Next Record >
Goto Last Record >|

You can then enter your code in the on click event of Each Button as follows

'Code for Next record shown but the same If, then msgbox end if code applies
Private Sub Command16_Click()
On Error GoTo Err_Command16_Click


DoCmd.GoToRecord , , acNext
If Me.Expiration Date < Date Then
MsgBox "Expired"
End If

Exit_Command16_Click:
Exit Sub

Err_Command16_Click:
MsgBox Err.Description
Resume Exit_Command16_Click

End Sub

'Because you have a gap in the control name you may have to enclose
[Expiration Date] in Brackets


This way, which ever way the user scrolls up or down the records, a msgbox
will display.

hth helps, will try some other methods and let you know

Mike B
--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you have tried all,
you have shouted at and blamed the innocent,
and asked everyone you know,

READ THE INSTRUCTION MANUAL.


Johnnie_on_the_Spot said:
Oh by the way that is a dead link

MikeJohnB said:
The link below allows you to download a demo zip file which set mouse over
events, Button text changes as you move the mouse over them. It is
accomplished with VBA code though but you might be able to work that out.

http://www.datastrat.com/Download/MouseMove.zip


hth? Mike B
--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you have tried all,
you have shouted at and blamed the innocent,
and asked everyone you know,

READ THE INSTRUCTION MANUAL.


:

I am trying to set up a MsgBox function in a form I have designed for the
management of contracts. However, I am having trouble getting it to return
the message in the way I need it too. The database has over 50 contracts with
numerous pieces of information on each. One of which is the expiration date
of the contract. While scrolling through all contracts, I need MsgBox to
return the message "expired contract" whenever the expired contract is pulled
up regardless whether the expiration date field is highlighted or not. I am
using a simple macro ([Expiration Date]<Date())and it returns the appropriate
message if the expiration date feild is highlighted or if i move the mouse
near the feild. I have been expirimenting with the properties area to try and
get this to happen by but have now given up and am asking for some help.
Thank you for you time and please let me know if I can offer any additional
info needed to solve this problem.
[/QUOTE]
 

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

Top