P
PeteVTX
Can anyone help?
I am opening a form with subforms and I want to move to a specific record
upon opening. The underlying table includes an integer field which is the
Primary Key and I would like to use this field to find the record i.e.
DoCmd.GoToControl "empID" [primary key integer field]
DoCmd.FindRecord empID, , True, , True, , True [empID set to target record
when form opened]
But this doesn't work!
However:
DoCmd.GoToControl "userName" [string field that SHOULD be unique but on user
error may not be]
DoCmd.FindRecord userName, , True, , True, , True [userName set to target
record when form opened]
Does work!!
I don't really want to use userName to locate the record because there is a
chance of duplicated value in this field. I want to use empID to locate the
record.
Amy thoughts on why the first option doesn't work would be most welcome.
Best regards
Pete
I am opening a form with subforms and I want to move to a specific record
upon opening. The underlying table includes an integer field which is the
Primary Key and I would like to use this field to find the record i.e.
DoCmd.GoToControl "empID" [primary key integer field]
DoCmd.FindRecord empID, , True, , True, , True [empID set to target record
when form opened]
But this doesn't work!
However:
DoCmd.GoToControl "userName" [string field that SHOULD be unique but on user
error may not be]
DoCmd.FindRecord userName, , True, , True, , True [userName set to target
record when form opened]
Does work!!
I don't really want to use userName to locate the record because there is a
chance of duplicated value in this field. I want to use empID to locate the
record.
Amy thoughts on why the first option doesn't work would be most welcome.
Best regards
Pete