cboMoveTo code by Allen Browne

C

chris

I am using the code provided by Allen.

Dim rs As DAO.Recordset
If Not IsNull(Me.cboMoveTo) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[ExpNumber] = """ & Me.cboMoveTo & """"
If rs.NoMatch Then
MsgBox "Not found: filtered?"
Else
'Display the found record in the form.
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If

It works...except in this situation. When I open the form from the Forms
menu, it works fine. When I open the form via a Switchboard command, the
form opens but when I select my crteria from the drop down menu I get the
Msg Box. If I exit the form, open from Forms menu, it will work fine again.
Only when I activate it from the switchboard does it faulter. Any ideas?
 
S

strive4peace

Hi Chris,

the switchboard must be filtering the form... check the OpenForm
parameters for the switchboard button that opens the form

If you want to position on a partilar record, it is better to send the
ID of the record as an OpenArg to the form and check the OpenArgs when
the form loads


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
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