What is the error? Can't set the focus or control not found or something else?
Is the control disabled? If so, SetFocus fails.
What is G_Grid? If it's a variable, is it a string, a number or something else? in the context shown, Access will try to convert it to a string and a number may get a leading space, which changes the value of the string. If it's another control on the form, is Value the default property? Is it null?
Add a break point on this line of code, run it and in the immediate window type:
? "heb" & G_Grid
When you hit enter, you will see what the literal is after Access has converted it.
If G_Grid is an integer and it is equal to 3, then the value of "heb" & G_Grid = "heb 3" which is not the same as "heb3".
I'm surprised you did not encounter that in Access 2003 since the method of implicitly converting data types hasn't changed all that much. I'm guessing there is something else in the 2003 version that lead to it working. In any case, try Me.Controls("heb" & Format(G-Grid)).SetFocus
Using the Me ensures Access is associating Controls with the right parent object and using Format explicitly converts a number to a string with no leading space.
ok, the message indicates the correct name is being grabbed (Heb3).
You verified Heb3 exists, correct?
Beyond that, the most common reasons for a control to not take focus are:
1) The control has Visible false or Enabled false
2) The container has Visible false or Enabled false (subform, tab control ,etc.)
3) It can't find the control
Put a break point in the code and check the status of the control in the Immediate Window.
Since you mentioned the move from Access 2003 to 2007 several times, did you verify the references are still valid and that ADO and DAO aren't getting crossed? If a reference is no longer valid, Access will gag at obscure, unrelated points of code.