Kamis, 26 Januari 2012

[MS_AccessPros] Re: Combo Box used for parameter query, form, and report

 

I've done some research online and have found that if I set the query to a DISTINCT query it will remove the duplicates. However, I'm not very Access savy and don't know where exactly this should go.

Any help is appreciated!

Thanks!

Katrina

--- In MS_Access_Professionals@yahoogroups.com, ka0t1c_ang3l <no_reply@...> wrote:
>
> Crystal,
>
> Np! I'm more than happy to share with everyone else. I did run into a problem that I can't seem to figure out how to do, or I've just been working on this database TOO long. I've entered my invoice information and some invoices have the same project #. Therefore, when I'm trying to run a report based on query that groups all the project #'s together, in the drop down menu the same project #'s are displayed multiple times because there's that many invoices with the same project number. How can I keep duplicates from being displayed in the drop down menu and have it displayed only once, yet would not delete out any records?
>
> I hope that makes sense!
>
> Thanks!
>
> Katrina
>
> --- In MS_Access_Professionals@yahoogroups.com, Crystal <strive4peace2008@> wrote:
> >
> > Hi Katrina,
> >
> > thanks for posting your solution :) glad you got it
> >
> >
> > Warm Regards,
> > Crystal
> >
> > Microsoft MVP
> > remote programming and training
> >
> > Access Basics by Crystal
> > http://www.AccessMVP.com/strive4peace
> > Free 100-page book that covers essentials in Access
> >
> >  *
> >    (: have an awesome day :)
> >  *
> >
> >
> >
> >
> > ________________________________
> > From: ka0t1c_ang3l
> >
> > I found my error!  I forgot to add in the code for the function.
> >
> > Option Compare Database
> > Option Explicit
> > Public bInReportOpenEvent As Boolean ' Is report in the Open event?
> >
> > Function IsLoaded(ByVal strFormName As String) As Boolean
> > ' Returns True if the specified form is open in Form view or Datasheet view.
> >     Dim oAccessObject As AccessObject
> >
> >     Set oAccessObject = CurrentProject.AllForms(strFormName)
> >     If oAccessObject.IsLoaded Then
> >         If oAccessObject.CurrentView <> acCurViewDesign Then
> >             IsLoaded = True
> >         End If
> >     End If
> >    
> > End Function
> >
> > Thanks!
> >
> > Katrina
> >
> >
> > --- In MS_Access_Professionals@yahoogroups.com, ka0t1c_ang3l <no_reply@> wrote:
> > >
> > > I created a custom dialog box (Vendor Dialog Box) that has a combo box and I have a query that will be the recordsource of this combo box.  I've also created a report based on this query.  What I want is when the report is opened it will open the Vendor Dialog Box and allow the user to select a vendor from the drop down menu, and based on that selection the report will be displayed.  I have added my capital project invoice log into the AssistantNeeded folder.
> > >
> > > I'm receiving a compile error: sub or function not defined.  The following is the code I'm using and I'm getting the error on the IsLoaded portion of the code:
> > >
> > > Option Compare Database
> > >
> > > Private Sub Report_Close()
> > >    DoCmd.Close acForm, "Vendor Dialog Box"
> > > End Sub
> > >
> > > Private Sub Report_Open(Cancel As Integer)
> > >    ' Set public variable to true to indicate that the report
> > >    ' is in the Open event
> > >    bInReportOpenEvent = True
> > >   
> > >    ' Open Vendor Dialog Box
> > >    DoCmd.OpenForm "Vendor Dialog Box", , , , , acDialog
> > >
> > >    ' Cancel Report if User Clicked the Cancel Button
> > >    If IsLoaded("Vendor Dialog Box") = False Then Cancel = True
> > >
> > >    ' Set public variable to false to indicate that the
> > >    ' Open event is completed
> > >    bInReportOpenEvent = False
> > > End Sub
> > >
> > > Any help is appreciated!!
> > >
> > > Thanks!
> > >
> > > Katrina
> > >
> >
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>

__._,_.___
.

__,_._,___

Tidak ada komentar:

Posting Komentar