Find record combo boxes not populating form with correct informati

G

Guest

I have a form with several combo boxes (6 total, 2 cascading) allowing a user
to choose how they will find a clients information. ie: select client by last
name, select client by ss#, select client by Client ID, select client by
Birth Date.

After the client is selected a subform shows all of their transactions and
you can select to edit a previous transaction or add a new transaction.

When you edit or add a transaction a new form is opened and when you close
that form you are back at the select client form.

Everything seems to work fine for about 100 entries, then my combo boxes
loose their minds and you click on Sally Smith and the record returned is Jim
Holliday.
Nothing makes sense until I delete all of the combo box selections and press
the remove filter/sort button; Then the combo boxes work fine again for
another 100 or so records.

Is there a way that when the transaction form closes all information and
filters on the select client form would be purged?

Any help would be appreciated.

Thanks,
Jennifer
 
S

strive4peace

Hi Jennifer,

In each of your combos, the first field should be the
ClientID (assuming you have an autonumber primarykey in your
clients table) -- even though you are looking up info other ways

then you can use a generic function for the AfterUpdate
event of each combo
--> =FindRecord()

'~~~~~~~~~~~~
Private Function FindRecord()

If IsNull(Me.ActiveControl) Then Exit Function

'save current record if changes were made
If me.dirty then me.dirty = false

Dim mRecordID As Long
mRecordID = Me.ActiveControl
Me.ActiveControl = Null
Me.RecordsetClone.FindFirst "ClientID= " & mRecordID

If Not Me.RecordsetClone.NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
Exit Function
End If

End Function
'~~~~~~~~~~~~

by using the primary key of your table to find records, it
will be more efficient. I have never had problems using
this method and I do it all my databases

without knowing more about what you are doing, I am simply
trying to give you a good method to use

'~~~~~~~~~~~~ DECOMPILE

if your database is acting odd, you may want to try
decompiling it


make an icon with this as its target:

"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE"
"C:\path\filename.mdb" /decompile

if your Access program is not located in the directory
specified, make the appropriate substitution

after you do this, compile it if you have any code and then
do compact/repair


Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top