Search Problem

  • Thread starter Musa via AccessMonster.com
  • Start date
M

Musa via AccessMonster.com

I used the wizard to create a Search Button . The problem with the button is
that it doesn't consistently work. Sometimes, I get "You can't use Find or
Replace now." when I open the database form. I have the form data entry
property set to NO. The data mode is set to Add.

Do you have any idea why this would not work?

Thanks..



Private Sub Command55_Click()
On Error GoTo Err_Command55_Click


Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Command55_Click:
Exit Sub

Err_Command55_Click:
MsgBox Err.Description
Resume Exit_Command55_Click

End Sub
 
S

strive4peace

try this:

before you run the code, save the current record

'see if record has changed
if me.dirty then
'save the record
me.dirty = false
end if

I would also suggest you add a comment above
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
as this statement is not intuitive at all -- obviously generated by the
'wizard'

over time, when you look through your code, you will not remember what
it does -- especially since you did not give your command button,
Command55, a meaningful Name...

Warm Regards,
Crystal

Access Basics
8-part free tutorial that covers essentials in Access
http://www.accessmvp.com/Strive4Peace/Index.htm

*
:) have an awesome day :)
*
 

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

Similar Threads


Top