Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / February 2008

Tip: Looking for answers? Try searching our database.

Need Help Please

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
teelee - 20 Feb 2008 23:22 GMT
I have my database built and I'm experiencing one problem that I can't seem
to get to the bottom of. I have a Form and on this form I have a combo box
where you would select an Individual employee to where you would only see
that individuals information on the report. But the problem I'm running into
is when I select a employee and want to view the info in a report it will not
show any info for that employee. I hope this doesn't sound to confussion, but
I'm lost with this and appreciate any assistance anyone can give.

Thanks
Jeanette Cunningham - 21 Feb 2008 04:26 GMT
teelee,
it would help if you copied and pasted the code you have and post it back
here.
Include details of version and details about what you are trying do.

Jeanette Cunningham

>I have my database built and I'm experiencing one problem that I can't seem
> to get to the bottom of. I have a Form and on this form I have a combo box
[quoted text clipped - 8 lines]
>
> Thanks
teelee - 21 Feb 2008 14:02 GMT
Ok here is the code: Private Sub PreviewRpt_Click()
On Error GoTo Err_PreviewRpt_Click
   
   Dim stDocName As String
   
   stDocName = "Individual Plans Reports"
   DoCmd.OpenReport stDocName, acPreview
   
Exit_PreviewRpt_Click:
Exit Sub

Err_PreviewRpt_Click:
   MsgBox Err.Description
   Resume Exit_PreviewRpt_Click
   
End Sub

> teelee,
> it would help if you copied and pasted the code you have and post it back
[quoted text clipped - 15 lines]
> >
> > Thanks
Jeanette Cunningham - 21 Feb 2008 20:48 GMT
yes
> Ok here is the code: Private Sub PreviewRpt_Click()
> On Error GoTo Err_PreviewRpt_Click
[quoted text clipped - 37 lines]
>> >
>> > Thanks
Jeanette Cunningham - 21 Feb 2008 20:54 GMT
The code you posted opens the report with all records.
To show records for a single employee, there is a where condition you can
use in the code like this:

DoCmd.OpenReport stDocName, acPreview, , "[EmployeeID] = " & Me.cboEmployee
& ""

Replace EmployeeID with the name of the ID field for employees and
replace cboEmployee with the name of your combo.

Jeanette Cunningham

> Ok here is the code: Private Sub PreviewRpt_Click()
> On Error GoTo Err_PreviewRpt_Click
[quoted text clipped - 37 lines]
>> >
>> > Thanks
teelee - 22 Feb 2008 14:55 GMT
I sent you the code for the wrong form, please see below for the correct
code. This database has plans for homes that you can purchase so what I want
to do is be able to just see each invididual plan sold when I click.

Thanks

Private Sub PreviewRpt_Click()
On Error GoTo Err_PreviewRpt_Click
   
   Dim stDocName As String
   
   stDocName = "Individual Plans Reports"
   DoCmd.OpenReport stDocName, acPreview
   
Exit_PreviewRpt_Click:
Exit Sub

Err_PreviewRpt_Click:
   MsgBox Err.Description
   Resume Exit_PreviewRpt_Click
   
End Sub

> The code you posted opens the report with all records.
> To show records for a single employee, there is a where condition you can
[quoted text clipped - 49 lines]
> >> >
> >> > Thanks
BruceM - 22 Feb 2008 15:06 GMT
Jeanette's suggestion still applies.  Remember that only you can see your
database, so people here do not know exactly what you mean by "each
individual plan".  You are in a form, and you are clicking a button to open
a report to the record that matches some field on your form.  If the linking
field is PlanID, and PlanID is a number field:
DoCmd.OpenReport stDocName, acPreview, , "[PlanID] = " & Me.PlanID & ""
If PlanID is a text field:
DoCmd.OpenReport stDocName, acPreview, , "[PlanID] = """ & Me.PlanID & """"

What you are doing here is telling Access to open a report for the record in
which PlanID matches PlanID on your form.

>I sent you the code for the wrong form, please see below for the correct
> code. This database has plans for homes that you can purchase so what I
[quoted text clipped - 79 lines]
>> >> >
>> >> > Thanks
Jeanette Cunningham - 22 Feb 2008 22:09 GMT
teelee,
For example if the combo had 2 columns
1st column was ReportID
2nd column was ReportName

When user selects a Plan report name
the combo's hidden column selects the correct ReportID

Your code wants to open the report that has the ReportID selected in the
combo

So we go
DoCmd.OpenReport stDocName, acPreview, , , "[ReportID] = " & Me.TheComboName
& ""

Replace ReportID and TheComboName with the correct names for your form.

Jeanette Cunningham

>I sent you the code for the wrong form, please see below for the correct
> code. This database has plans for homes that you can purchase so what I
[quoted text clipped - 79 lines]
>> >> >
>> >> > Thanks
teelee - 22 Feb 2008 15:14 GMT
I'm a little confussed right now. I have this in a form and what I want to
happen is, when I will select a plan (which is a combo box) and then click on
the command button which should open the report for individual plans. I have
a comman button and a combo box on this form.

Thanks

> I have my database built and I'm experiencing one problem that I can't seem
> to get to the bottom of. I have a Form and on this form I have a combo box
[quoted text clipped - 5 lines]
>
> Thanks
BruceM - 22 Feb 2008 17:54 GMT
I don't know if you saw what I wrote when you posted this, but have you
tried implementing the suggestion?  If not, is it because you don't
understand it?  If that is the case, what is the connection between the
current record on the form and the report you want to open?  In other words,
you want to open a report that has something in common with the current
record on the form.  What do the current record and the record in the report
have in common?

> I'm a little confussed right now. I have this in a form and what I want to
> happen is, when I will select a plan (which is a combo box) and then click
[quoted text clipped - 19 lines]
>>
>> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.