Can't reference form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am trying to go to the first record in a subform. I am using the following
command:

DoCmd.GoToRecord acDataForm, [Forms]![lkrbfrm_Orders]![sfrm_OrdMDetails],
acFirst

However I am getting an error:

"Error 2498
An expression you entered is the wrong data type for one of the arguments"

I presume its trying to tell me it wants a string in the 2nd argument of my
command and I am giving it a form.

How do I get aroung this problem

Robert
 
Robby,

If your code is activated from an event on the subform itself, I think
it should work with no specification, i.e. ...
DoCmd.GoToRecord , , acFirst

If your code is activated from elsewhere, you will need to use either
GoToControl or SetFocus to get yourself onto the subform first.
 
Back
Top