I've now tried this a few times with no luck--
you know how you add a button on a form that will open a further form. You can select "Find specific data to display". Well, when I selec that option (which I want to do) up comes the screen where you can match the criteria. I find that my "left" column (primary form) is completely blank, whereas the "right" column (popup form) has the full range of fields.
I have manually tried to add the criteria in VB using VB from a similar button and replacing the necessary and my code now looks like--
Problem is now, even after I've manually added the code when I push the button in Form view, the link criteria doesn't work and the popup form simply goes to the first record rather than filtering on the criteria.
For info: "Unit Number" is the field on my primary form that contains patient hospital details and "NUMBER" is the related field in the popup form that contains certain dental data from the dental table.
Can anyone tell me why - A) the column is blank when selecting link criteria and B) after I've added the VB, why it still doesn't work?
I've tried deleting the button and starting over and the same results every time.
Thanks in advance for any help.
you know how you add a button on a form that will open a further form. You can select "Find specific data to display". Well, when I selec that option (which I want to do) up comes the screen where you can match the criteria. I find that my "left" column (primary form) is completely blank, whereas the "right" column (popup form) has the full range of fields.
I have manually tried to add the criteria in VB using VB from a similar button and replacing the necessary and my code now looks like--
Code:
Private Sub Command124_Click()
On Error GoTo Err_Command124_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm5YearAudit"
stLinkCriteria = "[Unit Number]=" & Me![NUMBER]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command124_Click:
Exit Sub
Err_Command124_Click:
MsgBox Err.Description
Resume Exit_Command122_Click
End Sub
Problem is now, even after I've manually added the code when I push the button in Form view, the link criteria doesn't work and the popup form simply goes to the first record rather than filtering on the criteria.
For info: "Unit Number" is the field on my primary form that contains patient hospital details and "NUMBER" is the related field in the popup form that contains certain dental data from the dental table.
Can anyone tell me why - A) the column is blank when selecting link criteria and B) after I've added the VB, why it still doesn't work?
I've tried deleting the button and starting over and the same results every time.
Thanks in advance for any help.