Alarm form

K

Kay

Hi

At last managed to create a basic reminder alarm for my database. I
have used a table to create alarm fields and a form to sotre the
reminders. I have come across 2 problems

1) it may be easy but ive never come across it before. I have used a
msgbox to alert the user using the following
MsgBox ("A Job is Due.... Alarm ID = " & AlarmID & _
(" Alarm Message = ") & AlarmMessage & _
" Please tick the reset box on the alarm form to reset the alarm")

The problem is this is displayed all on one line. How can I get it to
drop some of it to go on the next line.

2) I was thinking of using a form to display the message as this can be
customised and look better. In my message form, how can I refer to my
fields in the main form

e.g msg on form = "A job is due.... Alarm id =" alarmid
"Alarm Message" = alarmmessage

How can I get the alarmid and alarmmessage to refer to my fields on the
main alarm form

Your help will be much appreciated
Thanks
 
G

Guest

See answers below questions

Kay said:
Hi

At last managed to create a basic reminder alarm for my database. I
have used a table to create alarm fields and a form to sotre the
reminders. I have come across 2 problems

1) it may be easy but ive never come across it before. I have used a
msgbox to alert the user using the following
MsgBox ("A Job is Due.... Alarm ID = " & AlarmID & _
(" Alarm Message = ") & AlarmMessage & _
" Please tick the reset box on the alarm form to reset the alarm")

The problem is this is displayed all on one line. How can I get it to
drop some of it to go on the next line.
You can use vbCrLf or vbNewLine to start a new line on your message box
MsgBox "This is the first line" & vbCrLf & "This is the second line"
2) I was thinking of using a form to display the message as this can be
customised and look better. In my message form, how can I refer to my
fields in the main form
If you use the message box (much easier and faster) you just use
Me.SomeField
If you use a form it would be Forms!AlarmFormName!SomeField
e.g msg on form = "A job is due.... Alarm id =" alarmid
"Alarm Message" = alarmmessage

How can I get the alarmid and alarmmessage to refer to my fields on the
main alarm form
Sorry, I don't understand this question.
 
J

John Vinson

1) it may be easy but ive never come across it before. I have used a
msgbox to alert the user using the following
MsgBox ("A Job is Due.... Alarm ID = " & AlarmID & _
(" Alarm Message = ") & AlarmMessage & _
" Please tick the reset box on the alarm form to reset the alarm")

The problem is this is displayed all on one line. How can I get it to
drop some of it to go on the next line.

Use

& vbCrLf &

where you want a new line.
2) I was thinking of using a form to display the message as this can be
customised and look better. In my message form, how can I refer to my
fields in the main form

e.g msg on form = "A job is due.... Alarm id =" alarmid
"Alarm Message" = alarmmessage

How can I get the alarmid and alarmmessage to refer to my fields on the
main alarm form

for alarmid, use

[Forms]![MainAlarmForm]![AlarmID]

and so on.

John W. Vinson[MVP]
 
K

Kay

thanks for all your help guys, got another problem with this code

If Me.AlarmDate = Date And Me.AlarmTime <= Time() And Me.Reset = False
Then
MsgBox ("A Job is Due"), vbCrLf & _
("ALARM ID = ") & AlarmID & _
vbCrLf & ("ALARM MESSAGE = ") & AlarmMessage & vbCrLf & ("Please tick
the reset box on the alarm form to reset the alarm")

error = type mismatch

can anyone help please
 
K

Kay

Actually just got it working, Is there a way of changing the text and
colors of a messagebox
 
J

John Vinson

Actually just got it working, Is there a way of changing the text and
colors of a messagebox

Not really. You might want to use a little popup Form instead, that
gives you full control.

John W. Vinson[MVP]
 

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

Alarm message 7
Problem with code 10
Alarm Code error 3
Reminder Problem 3
Code error 4
Reminder Problem 1
Alarm in access 1
duplicated New Record 1

Top