Runtime error 2110

dancat

Registered User.
Local time
Today, 22:26
Joined
Jan 22, 2009
Messages
30
Hi there

Please excuse me i am a novice at access. I am getting a runtime error '2110' - access can't move the focus to the control ProductID

What i am trying to do is when a query is ran from the products form it displays another form with all possible matching records (this works ok), but the next step is if you click on one the the matches is should then take you back to the first form and display the relevent information for the record you selected.

when selecting which record i want to go to, i get the runtime error:

here is the code that i am using:

Private Sub List0_Click()
SearchID = List0
DoCmd.OpenForm "Products"
DoCmd.GoToControl "ProductID"
DoCmd.Close acForm, "frmProduct"
DoCmd.FindRecord SearchID
End Sub

Any ideas, thanks
 
Are you sure that the first form is open ???
 
yep can see the first form is still open after results are displayed on new form
 
DoCmd.OpenForm "Products"
DoCmd.GoToControl "ProductID"
DoCmd.Close acForm, "frmProduct

not sure

i think you are trying to goto productid on the "current form" - not on the just opened form.

either that, or maybe productid is not enabled
 
Thanks for the replys you see I have used this code before on another database i have done and it works great, i just cant understand why i am getting the runtime error with this one, as i can see no differences between them.

What is this set focus thing??

been at it all day..eyes going cross-eyed.....lol

just for reference 2 forms are :

Products = Main Form
frmproduct = second Form which displays results from a search query ran in Products form
 
Last edited:
Hi thanks for the help you were correct, productid wasn't enabled.

works great now

Thanks again for your help

Mark
 

Users who are viewing this thread

Back
Top Bottom