on dirty

E

Eugene

I am trying to get the following to work:

Private Sub Nurse_Assigned_Dirty(Cancel As Integer)
If nurses.pritoday = "No" Then
msgbox("No PRIs today for this nurse" ,vbOKOnly,"No Pri Today",,)
End If

End Sub

Access keeps returning a syntax error.

What am I doing wrong?

Thanks in advance
 
G

Gina Whipp

Eugene,

Try the below... Note, if you have nothing for the ending parameters, leave
off the trailing commas. Also, the below is based on the fact that you are
not getting the "No" answer from the message box.

Private Sub Nurse_Assigned_Dirty(Cancel As Integer)
If nurses.pritoday = "No" Then
MsgBox "No PRIs today for this nurse" ,vbOKOnly,"No Pri Today"
End If
End Sub

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
E

Eugene

Actually this is what happens...

A nurse is selected from a list. with in the list is a field that says if
he/she is accepting PRIs today. If the field is no, when a nurse is selected,
a msgbox shoudl pop up and say "Not today"...click on ok it will reset the
field to select a new nurse.

Thanks Gina.
 
E

Eugene

Gina,

Maybe I am really dense, but I am getting the following error

Runtime error '424':

Object Required.

My code is as follows:

Private Sub Nurse_Assigned_Dirty(Cancel As Integer)

If nurses.pritoday = "No" Then
MsgBox "No PRIs today for this nurse", vbOKOnly, "No Pri Today"



End If
End Sub

I am not a VB expert not even close. HELP......
 
E

Eugene

Nurses is a table, pritoday is a field in the table associated with nurse
record.

Can send you a screenprint?

My email address is eugene dot wohlfarth at wellpoint dot com

Thanks,
Eugene
 

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