Print Preview error

L

LHEMA

I need help....when I click the print preview button on the form it goes
directly to the code page and display and error "DoCmd.OpenReport "rpt
Employee Accidents", acViewPreview, , strWhere"

It work before I do not know what is wrong any help is appreciated
Here is how the code looks:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub
 
O

Ofer

What is the field type of employeeID#?

If its a number, try this
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

What is the error you are getting?
 
L

LHEMA

Yes it is a number field, I change the expression and it still do not work.
The message error I am recieving is a data type mismatch in criteria
expression. I have check everything and can not find it
--
LHEMA


Ofer said:
What is the field type of employeeID#?

If its a number, try this
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

What is the error you are getting?

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



LHEMA said:
I need help....when I click the print preview button on the form it goes
directly to the code page and display and error "DoCmd.OpenReport "rpt
Employee Accidents", acViewPreview, , strWhere"

It work before I do not know what is wrong any help is appreciated
Here is how the code looks:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub
 
O

Ofer

Can you post the code you have now?



LHEMA said:
Yes it is a number field, I change the expression and it still do not work.
The message error I am recieving is a data type mismatch in criteria
expression. I have check everything and can not find it
--
LHEMA


Ofer said:
What is the field type of employeeID#?

If its a number, try this
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

What is the error you are getting?

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



LHEMA said:
I need help....when I click the print preview button on the form it goes
directly to the code page and display and error "DoCmd.OpenReport "rpt
Employee Accidents", acViewPreview, , strWhere"

It work before I do not know what is wrong any help is appreciated
Here is how the code looks:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub
 
L

LHEMA

Yes, heres the code I presently have:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub

--
LHEMA


Ofer said:
Can you post the code you have now?



LHEMA said:
Yes it is a number field, I change the expression and it still do not work.
The message error I am recieving is a data type mismatch in criteria
expression. I have check everything and can not find it
--
LHEMA


Ofer said:
What is the field type of employeeID#?

If its a number, try this
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

What is the error you are getting?

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

I need help....when I click the print preview button on the form it goes
directly to the code page and display and error "DoCmd.OpenReport "rpt
Employee Accidents", acViewPreview, , strWhere"

It work before I do not know what is wrong any help is appreciated
Here is how the code looks:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub
 
O

Ofer

Try this

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] =" & Me.[EmployeeID#]
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub


--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



LHEMA said:
Yes, heres the code I presently have:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub

--
LHEMA


Ofer said:
Can you post the code you have now?



LHEMA said:
Yes it is a number field, I change the expression and it still do not work.
The message error I am recieving is a data type mismatch in criteria
expression. I have check everything and can not find it
--
LHEMA


:

What is the field type of employeeID#?

If its a number, try this
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

What is the error you are getting?

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

I need help....when I click the print preview button on the form it goes
directly to the code page and display and error "DoCmd.OpenReport "rpt
Employee Accidents", acViewPreview, , strWhere"

It work before I do not know what is wrong any help is appreciated
Here is how the code looks:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub
 
L

LHEMA

Thank you so much it work....

Could you tell me what I did wrong so in the future I would know the
problem.Again Thank you
--
LHEMA


Ofer said:
Try this

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] =" & Me.[EmployeeID#]
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub


--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



LHEMA said:
Yes, heres the code I presently have:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub

--
LHEMA


Ofer said:
Can you post the code you have now?



:

Yes it is a number field, I change the expression and it still do not work.
The message error I am recieving is a data type mismatch in criteria
expression. I have check everything and can not find it
--
LHEMA


:

What is the field type of employeeID#?

If its a number, try this
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

What is the error you are getting?

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

I need help....when I click the print preview button on the form it goes
directly to the code page and display and error "DoCmd.OpenReport "rpt
Employee Accidents", acViewPreview, , strWhere"

It work before I do not know what is wrong any help is appreciated
Here is how the code looks:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub
 
L

LHEMA

Thank you so much....it works!!!

Can you tell me what I was doing wrong so that if this happens again I would
know.Again Thanks for all your help
--
LHEMA


Ofer said:
Try this

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] =" & Me.[EmployeeID#]
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub


--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



LHEMA said:
Yes, heres the code I presently have:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub

--
LHEMA


Ofer said:
Can you post the code you have now?



:

Yes it is a number field, I change the expression and it still do not work.
The message error I am recieving is a data type mismatch in criteria
expression. I have check everything and can not find it
--
LHEMA


:

What is the field type of employeeID#?

If its a number, try this
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

What is the error you are getting?

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

I need help....when I click the print preview button on the form it goes
directly to the code page and display and error "DoCmd.OpenReport "rpt
Employee Accidents", acViewPreview, , strWhere"

It work before I do not know what is wrong any help is appreciated
Here is how the code looks:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub
 
L

LHEMA

Thank you so much....it works!!!

Can you tell me what I was doing wrong so that if this happens again I would
know.Again Thanks for all your help
--
LHEMA


Ofer said:
Try this

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] =" & Me.[EmployeeID#]
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub


--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



LHEMA said:
Yes, heres the code I presently have:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub

--
LHEMA


Ofer said:
Can you post the code you have now?



:

Yes it is a number field, I change the expression and it still do not work.
The message error I am recieving is a data type mismatch in criteria
expression. I have check everything and can not find it
--
LHEMA


:

What is the field type of employeeID#?

If its a number, try this
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

What is the error you are getting?

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

I need help....when I click the print preview button on the form it goes
directly to the code page and display and error "DoCmd.OpenReport "rpt
Employee Accidents", acViewPreview, , strWhere"

It work before I do not know what is wrong any help is appreciated
Here is how the code looks:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub
 
L

LHEMA

Thank you so much....it works!!!

Can you tell me what I was doing wrong so that if this happens again I would
know.Again Thanks for all your help

I am not sure if you are getting the post..my server keeps going down, sorry
for the duplicate replies
--
LHEMA


Ofer said:
Try this

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] =" & Me.[EmployeeID#]
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub


--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



LHEMA said:
Yes, heres the code I presently have:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub

--
LHEMA


Ofer said:
Can you post the code you have now?



:

Yes it is a number field, I change the expression and it still do not work.
The message error I am recieving is a data type mismatch in criteria
expression. I have check everything and can not find it
--
LHEMA


:

What is the field type of employeeID#?

If its a number, try this
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

What is the error you are getting?

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

I need help....when I click the print preview button on the form it goes
directly to the code page and display and error "DoCmd.OpenReport "rpt
Employee Accidents", acViewPreview, , strWhere"

It work before I do not know what is wrong any help is appreciated
Here is how the code looks:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub
 
O

Ofer

You assigned the WhereCondition as String, when the field type is actually a
number.

For future reference

For string use
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
Or
strWhere = "[employeeID#] = '" & Me.[EmployeeID#] & "'"
============================================
For Number
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

============================================
For date
strWhere = "[employeeID#] = #" & Me.[EmployeeID#] & "#"

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



LHEMA said:
Thank you so much....it works!!!

Can you tell me what I was doing wrong so that if this happens again I would
know.Again Thanks for all your help

I am not sure if you are getting the post..my server keeps going down, sorry
for the duplicate replies
--
LHEMA


Ofer said:
Try this

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] =" & Me.[EmployeeID#]
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub


--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



LHEMA said:
Yes, heres the code I presently have:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub

--
LHEMA


:

Can you post the code you have now?



:

Yes it is a number field, I change the expression and it still do not work.
The message error I am recieving is a data type mismatch in criteria
expression. I have check everything and can not find it
--
LHEMA


:

What is the field type of employeeID#?

If its a number, try this
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

What is the error you are getting?

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

I need help....when I click the print preview button on the form it goes
directly to the code page and display and error "DoCmd.OpenReport "rpt
Employee Accidents", acViewPreview, , strWhere"

It work before I do not know what is wrong any help is appreciated
Here is how the code looks:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub
 
L

LHEMA

Thank you again for helping me solve the problem
--
LHEMA


Ofer said:
You assigned the WhereCondition as String, when the field type is actually a
number.

For future reference

For string use
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
Or
strWhere = "[employeeID#] = '" & Me.[EmployeeID#] & "'"
============================================
For Number
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

============================================
For date
strWhere = "[employeeID#] = #" & Me.[EmployeeID#] & "#"

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



LHEMA said:
Thank you so much....it works!!!

Can you tell me what I was doing wrong so that if this happens again I would
know.Again Thanks for all your help

I am not sure if you are getting the post..my server keeps going down, sorry
for the duplicate replies
--
LHEMA


Ofer said:
Try this

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] =" & Me.[EmployeeID#]
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub


--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

Yes, heres the code I presently have:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub

--
LHEMA


:

Can you post the code you have now?



:

Yes it is a number field, I change the expression and it still do not work.
The message error I am recieving is a data type mismatch in criteria
expression. I have check everything and can not find it
--
LHEMA


:

What is the field type of employeeID#?

If its a number, try this
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

What is the error you are getting?

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

I need help....when I click the print preview button on the form it goes
directly to the code page and display and error "DoCmd.OpenReport "rpt
Employee Accidents", acViewPreview, , strWhere"

It work before I do not know what is wrong any help is appreciated
Here is how the code looks:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub
 
O

Ofer

Your welcome, glad I could help


LHEMA said:
Thank you again for helping me solve the problem
--
LHEMA


Ofer said:
You assigned the WhereCondition as String, when the field type is actually a
number.

For future reference

For string use
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
Or
strWhere = "[employeeID#] = '" & Me.[EmployeeID#] & "'"
============================================
For Number
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

============================================
For date
strWhere = "[employeeID#] = #" & Me.[EmployeeID#] & "#"

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



LHEMA said:
Thank you so much....it works!!!

Can you tell me what I was doing wrong so that if this happens again I would
know.Again Thanks for all your help

I am not sure if you are getting the post..my server keeps going down, sorry
for the duplicate replies
--
LHEMA


:

Try this

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] =" & Me.[EmployeeID#]
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub


--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

Yes, heres the code I presently have:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub

--
LHEMA


:

Can you post the code you have now?



:

Yes it is a number field, I change the expression and it still do not work.
The message error I am recieving is a data type mismatch in criteria
expression. I have check everything and can not find it
--
LHEMA


:

What is the field type of employeeID#?

If its a number, try this
strWhere = "[employeeID#] = " & Me.[EmployeeID#]

What is the error you are getting?

--
Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck



:

I need help....when I click the print preview button on the form it goes
directly to the code page and display and error "DoCmd.OpenReport "rpt
Employee Accidents", acViewPreview, , strWhere"

It work before I do not know what is wrong any help is appreciated
Here is how the code looks:

Private Sub Print_Preview_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[employeeID#] = """ & Me.[EmployeeID#] & """"
DoCmd.OpenReport "rpt Employee Accidents", acViewPreview, , strWhere
End If
End Sub
 

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

Printview - debug error 1
Print the record in the form 1
Opening report 4
Printing Report 3
Report VB Code 1
Dynamic Naming of Form Button 3
HELP with Print Current Record 2
Print multiple reports 6

Top