Kamis, 09 Mei 2013

RE: [MS_AccessPros] Re: Combo Box Not Working

 

Doyce-

That's a more direct way to do it. I don't see your original code in the
thread anymore - maybe you were failing to set FilterOn = True? Note that
this new technique just navigates to the record but leaves all the others
available. Your previous technique to apply a filter should have resulted
in just the one record appearing.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of dnwinberry
Sent: Thursday, May 09, 2013 4:09 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Re: Combo Box Not Working

Duane,

That's what I'm trying to do, however it seems to be having trouble with
this line:
If Len(cboUnitID & vbNullString) < 0 Then...
even though it appears to be working in the immediate window when I
debug.print Len(cboUnitID & vbNullString) and get the correct number of
characters. However, I've been working this around and have found that the
code below works.

Dim rs As DAO.Recordset

Dim strComboVar As String

strComboVar = Me.cboUnitID

Me.Filter = ""
Me.FilterOn = False
DoEvents
Set rs = Me.Recordset
rs.FindFirst "[BOMID] = " & "'" & strComboVar & "'"
Set rs = Nothing

I would appreciate any insight you have on this.

Thanks for taking time to jump in!

Doyce


--- In MS_Access_Professionals@yahoogroups.com, Duane Hookom
<duanehookom@...> wrote:
>
> PMFJI but are you removing the filter prior to attempting to find a
record? If not, you are looking for something to eat in an empty fridge.
> Duane Hookom MVPMS Access
>
> > To: MS_Access_Professionals@yahoogroups.com
> > From: winberry.doyce@...
> > Date: Thu, 9 May 2013 12:39:56 +0000
> > Subject: [MS_AccessPros] Re: Combo Box Not Working
> >
> > Good morning John,
> >
> > The record source is table tblVINTagLinking. It has a PK of BOMID and
one other field TAGID. In the open event of the form, I have the following
code:
> >
> > me.Filter = "1=2"
> > me.FilterOn = True
> >
> > Doyce
> >
> > --- In MS_Access_Professionals@yahoogroups.com, John Viescas <JohnV@>
wrote:
> > >
> > > Doyce-
> > >
> > > What is the Record Source of the form, and how are you getting it
> > > to open showing no records?
> > >
> > > John Viescas, Author
> > > Microsoft Access 2010 Inside Out
> > > Microsoft Access 2007 Inside Out
> > > Microsoft Access 2003 Inside Out
> > > Building Microsoft Access Applications SQL Queries for Mere
> > > Mortals http://www.viescas.com/ (Paris, France)
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: MS_Access_Professionals@yahoogroups.com
> > > [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of
> > > dnwinberry
> > > Sent: Wednesday, May 08, 2013 11:43 PM
> > > To: MS_Access_Professionals@yahoogroups.com
> > > Subject: [MS_AccessPros] Re: Combo Box Not Working
> > >
> > > I'm with you Bob. Me too. I'll look at it again tomorrow with
> > > fresh eyes and see what happens.
> > >
> > > Thanks for helping me work on this.
> > >
> > > Doyce
> > >
> > > --- In MS_Access_Professionals@yahoogroups.com, "Bob"
> > > <rcleary171@>
> > > wrote:
> > > >
> > > > So the form is the variable. And this current form is the problem
child.
> > > Would it be worth the effort to construct a similar form from
> > > scratch and see if the problem persists? I'm sorry not being of
> > > great help - this is how I debug thing: a lot of tinkering and
> > > coming at the problem from different angles.
> > > >
> > > > --- In MS_Access_Professionals@yahoogroups.com, "dnwinberry"
> > > <winberry.doyce@> wrote:
> > > > >
> > > > > Bob,
> > > > >
> > > > > No change. I have noticed this however. On other forms that
> > > > > work when
> > > the event fires, the filtered at the bottom of the form changes to
> > > No Filter and it grayed out. This one does not change.
> > > > >
> > > > > Doyce
> > > > >
> > > >
> > >
> > >
> > >
> > >
> > > ------------------------------------
> > >
> > > Yahoo! Groups Links
> > >
> >
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>

------------------------------------

Yahoo! Groups Links

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (12)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar