A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Combo boxes work, then fail



 
 
Thread Tools Display Modes
  #11  
Old February 6th, 2007, 12:23 PM posted to microsoft.public.access.forms
BruceM
external usenet poster
 
Posts: 723
Default Combo boxes work, then fail

You could try this (although it seems to be pretty much what you tried in
the second example):

Dim rs as Object

Set rs = Me.RecordsetClone
rs.FindFirst "fldAllID = " & Me.Combo175
Me.Bookmark = rs.Bookmark

This code assumes that fldAllID is the key field (for the person whose
record you want to find, I assume), and that the bound column of Combo 175
is the same field. I can't see a reason for using Nz for an autonumber
field, which cannot be zero or null, or for wrapping the string function
around the field, which has the effect of adding a leading space, as I
understand it.

"OldFatherWilliam+" wrote in
message ...
Thanks, Bruce. Yes, the combo box is unbound. The code is:

Private Sub Combo175_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[fldAllID] = " & Str(Nz(Me![Combo175], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

I also have tried this, from another working database, with the names
changed to fit this database:

Sub Combo175_AfterUpdate()
' Find the record that matches the control.

Me.RecordsetClone.FindFirst "[fldAllID] = " & Me![Combo175]
Me.Bookmark = Me.RecordsetClone.Bookmark

End Sub

That code, generated by the wizard some years ago, works at first, then
fails after closing and re-starting the database.



"BruceM" wrote:

Is the combo box unbound? Since it is a search combo box, it should not
be
bound. What is the After Update code for the search combo box?

"OldFatherWilliam+" wrote in
message ...
I have a form with 28 enabled fields, 7 not enabled, for information
occasionally needed by the user, and a subform containing 13 fields.

The database is being prepared for a non-profit organization related to
autism.

I want to let the user select a particular person's record, using a
combo
box that contains the following fields: AutoNumber index (hidden),
Last-Name-First, Address and City-State-Zip.

When I set up the field, using the Properties box, Data tab and
RowSource
field to view the query and alphabetize the Last-Name-First, the combo
box
works perfectly.

If I close the database and re-open it, the combo box doesn't work. It
doesn't respond to any of the characters I type in that are the first
few
characters of one of the names in the form' underlying table. If I
click
on
the down arrow at the right end of the combo box, the list of entries
is
there, in alphabetical order.

I have other databases on this computer that are working perfectly,
allowing
me to find a record I am looking for.

When the primary combo box is working, several lookup fields on the
parent
form and on the sub form also let me type the first few characters of
an
option, see the rest of the choice in the field, and press Tab to
select
the
option viewed. When the combo box is not working, the lookup fields
also
do
not work.

If I change to the design view of the form, while the combo box is not
working, and create another combo box that does the same thing as the
primary
combo box, and return to the form view, the new combo box works, and
the
lookup fields also work, but closing and re-opening the database makes
all
of
them not work again.

One other symptom: There are three forms available to the user, one
with
fewer fields, but the same target for the combo box, and the other with
a
zip
code lookup in the combo box. When the combo box in one form works,
they
all
work. If the combo box on any of the forms fails, the combo boxes on
the
other forms also fail.

I have tried creating simpler forms, but the combo box operation in
them
has
the same problem.

Using the Compact and Repair routine makes the database smaller, but
does
not restore the operation of non-functioning combo boxes.

I also tried uninstalling Microsoft Office Pro 2003 and reinstalling
it,
but
the problem was not corrected.

Can anyone offer me another diagnostic/corrective path to take?

Thank you!

OldFatherWilliam+






  #12  
Old February 6th, 2007, 12:24 PM posted to microsoft.public.access.forms
OldFatherWilliam+
external usenet poster
 
Posts: 12
Default Combo boxes work, then fail

I had the same problem, but a tech person at EVERYTHINGACCESS found a KB
article that said that, with ANSI 92 installed, the RowSource has to say
SELECT DISTINCT, not just SELECT.

....OldFrWilliam
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:07 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.