Report Questions

G

GMac

Hello,
I could use some help with creating a report. I am wanting to run a report
that shows the training completed by an individual associate. How would I set
this up that it prompts the user to enter the assoiate ID to view a report on
that associate.

Any help would be great!
greg
 
D

Duane Hookom

I would create a form with a combo box to select the Associate ID. Name the
combo box cboAssocID. Then use the command button wizard to create a button
to open your report.

Then modify the code behind the command button so it looks somewhat like:

Dim strWhere as String
Dim stDocument as String
strWhere = "1=1 "
If not IsNull(Me.cboAssocID) Then
strWhere = strWhere & " AND [Associated ID] = " & Me.cboAssocID
End If
stDocument ="rptYourReport"
DoCmd.OpenReport stDocument, acPreview, , strWhere
 
G

GMac

Duane,

I got a error when I tried to view the report. It has to do with the ="1=1"

Duane Hookom said:
I would create a form with a combo box to select the Associate ID. Name the
combo box cboAssocID. Then use the command button wizard to create a button
to open your report.

Then modify the code behind the command button so it looks somewhat like:

Dim strWhere as String
Dim stDocument as String
strWhere = "1=1 "
If not IsNull(Me.cboAssocID) Then
strWhere = strWhere & " AND [Associated ID] = " & Me.cboAssocID
End If
stDocument ="rptYourReport"
DoCmd.OpenReport stDocument, acPreview, , strWhere

--
Duane Hookom
Microsoft Access MVP


GMac said:
Hello,
I could use some help with creating a report. I am wanting to run a report
that shows the training completed by an individual associate. How would I set
this up that it prompts the user to enter the assoiate ID to view a report on
that associate.

Any help would be great!
greg
 
D

Duane Hookom

You must reply with the full code as you entered it into your application.

--
Duane Hookom
Microsoft Access MVP


GMac said:
Duane,

I got a error when I tried to view the report. It has to do with the ="1=1"

Duane Hookom said:
I would create a form with a combo box to select the Associate ID. Name the
combo box cboAssocID. Then use the command button wizard to create a button
to open your report.

Then modify the code behind the command button so it looks somewhat like:

Dim strWhere as String
Dim stDocument as String
strWhere = "1=1 "
If not IsNull(Me.cboAssocID) Then
strWhere = strWhere & " AND [Associated ID] = " & Me.cboAssocID
End If
stDocument ="rptYourReport"
DoCmd.OpenReport stDocument, acPreview, , strWhere

--
Duane Hookom
Microsoft Access MVP


GMac said:
Hello,
I could use some help with creating a report. I am wanting to run a report
that shows the training completed by an individual associate. How would I set
this up that it prompts the user to enter the assoiate ID to view a report on
that associate.

Any help would be great!
greg
 
G

GMac

Duane,
Here is the code I have entered. I have an icon image that I had entered as
a procedure event upon click.

Dim strWhere As String
Dim stDocument As String
strWhere = "1=1"
If Not IsNull(Me.cboAssocID) Then
strWhere = strWhere & " AND [Outline].[Associate ID] = " & Me.cboAssocID
End If
stDocument = "Program Outline"
DoCmd.OpenReport stDocument, acPreview, , strWhere

Private Sub ViewOutline_Click()

End Sub

Duane Hookom said:
You must reply with the full code as you entered it into your application.

--
Duane Hookom
Microsoft Access MVP


GMac said:
Duane,

I got a error when I tried to view the report. It has to do with the ="1=1"

Duane Hookom said:
I would create a form with a combo box to select the Associate ID. Name the
combo box cboAssocID. Then use the command button wizard to create a button
to open your report.

Then modify the code behind the command button so it looks somewhat like:

Dim strWhere as String
Dim stDocument as String
strWhere = "1=1 "
If not IsNull(Me.cboAssocID) Then
strWhere = strWhere & " AND [Associated ID] = " & Me.cboAssocID
End If
stDocument ="rptYourReport"
DoCmd.OpenReport stDocument, acPreview, , strWhere

--
Duane Hookom
Microsoft Access MVP


:

Hello,
I could use some help with creating a report. I am wanting to run a report
that shows the training completed by an individual associate. How would I set
this up that it prompts the user to enter the assoiate ID to view a report on
that associate.

Any help would be great!
greg
 
D

Duane Hookom

If AssociateID is Numeric, try:
strWhere = strWhere & " AND [Associate ID] = " & Me.cboAssocID
If AssociateID is Text, try:
strWhere = strWhere & " AND [Associate ID] = """ & Me.cboAssocID & """"
--
Duane Hookom
Microsoft Access MVP


GMac said:
Duane,
Here is the code I have entered. I have an icon image that I had entered as
a procedure event upon click.

Dim strWhere As String
Dim stDocument As String
strWhere = "1=1"
If Not IsNull(Me.cboAssocID) Then
strWhere = strWhere & " AND [Outline].[Associate ID] = " & Me.cboAssocID
End If
stDocument = "Program Outline"
DoCmd.OpenReport stDocument, acPreview, , strWhere

Private Sub ViewOutline_Click()

End Sub

Duane Hookom said:
You must reply with the full code as you entered it into your application.

--
Duane Hookom
Microsoft Access MVP


GMac said:
Duane,

I got a error when I tried to view the report. It has to do with the ="1=1"

:

I would create a form with a combo box to select the Associate ID. Name the
combo box cboAssocID. Then use the command button wizard to create a button
to open your report.

Then modify the code behind the command button so it looks somewhat like:

Dim strWhere as String
Dim stDocument as String
strWhere = "1=1 "
If not IsNull(Me.cboAssocID) Then
strWhere = strWhere & " AND [Associated ID] = " & Me.cboAssocID
End If
stDocument ="rptYourReport"
DoCmd.OpenReport stDocument, acPreview, , strWhere

--
Duane Hookom
Microsoft Access MVP


:

Hello,
I could use some help with creating a report. I am wanting to run a report
that shows the training completed by an individual associate. How would I set
this up that it prompts the user to enter the assoiate ID to view a report on
that associate.

Any help would be great!
greg
 

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