"You can't use Find or Replace now" - Please help!!

branston

Registered User.
Local time
Today, 09:21
Joined
Apr 29, 2009
Messages
372
Hi,

I have a bit of code which im having real trouble with.
What it basically does is stores some variables, and then uses them to destinguish which form to open and which record to go to.

The form opens fine, but then i ask it to find the form which has ID = strID. Im using the following code:

DoCmd.OpenForm strFile
DoCmd.Maximize
DoCmd.GoToControl "ID"
DoCmd.FindRecord strID

Ive used the similar thing many times before and its worked fine, but here it is coming up with an error saying "You can't use Find or Replace now" which isnt overly helpfull.

Any ideas on why this error appears?

Thank you
 
not sure - i think i've seen this before

unsaved/dirty record? perhaps that stops it working

locked "id" field, so gotocontrol fails

form bound incorrectly? take out the logic, see if you can search the field manually

maybe no record in the form at all - that would make a search fail
 
Hi Dave,

thanks for the suggestions. It could be an unsaved record - ill try that. The thing i dont get (and that rules out the other posibilities) is if i try to do it manually (open the form, select the ID record and find a certain ID) it works! Ive checked the strID thats stored, and that record does exist.

I know its happened in other places, but ive always managed to find a reason for that!

Ill try saving the record 1st and seeing if that helps!
 

Users who are viewing this thread

Back
Top Bottom