Access 2003

J

Juanca

I converted my dataBase to access 2003 Now Doesn't Work, I use to display a
full AddressForm from a sub-form, now Icannot fixed. Help Please.
This is the sentence:

Private Sub SeeDet_Click()
On Error GoTo Err_SeeDet_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "FSNEmployees"
stLinkCriteria = "IDNum = Forms!FsnsByName!FSNEmployeesbyNamesf!IDNum"
***here open the FORM and pointing to a record that is in a sub form
FSNEmployeesbyNamesf ***
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms!FSNEmployees.SetFocus


Exit_SeeDet_Click:
Exit Sub

Err_SeeDet_Click:
MsgBox Err.Description
Resume Exit_SeeDet_Click

End Sub
 
O

Ofer

Try changing the criteria to

stLinkCriteria = "IDNum =
Forms![FsnsByName]![FSNEmployeesbyNamesf].form![IDNum]"

or to
If IDNum is number
stLinkCriteria = "IDNum = " & Me.FSNEmployeesbyNamesf.form.IDNum

If IDNum is string
stLinkCriteria = "IDNum = '" & Me.FSNEmployeesbyNamesf.form.IDNum & "'"
 
Top