Report Questions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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,

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
 
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
 
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
 
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
 
Back
Top