Posted on 2004-08-18
Hello all. This one will be simple to you guys but it's driving me totally nuts. I have a Clients Form that has a Command Button to open an Admissions Form. To filter the record being entered into the Admissions Form to be the same UniqueID as the current record in the Client Form I've added " stLinkCriteria = "[UniqueID]=" & Me![UniqueID]" in the On Click event of the Command Button. The complete code is:
Private Sub Command134_Click()
On Error GoTo Err_Command134_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Admissions"
stLinkCriteria = "[UniqueID]=" & Me![UniqueID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Simple right? Then in the Default Value property of the UniqueID field on the Admissions Form I've added
"=[Forms]![Clients]![UniqueID]". My problem is that when I click the button to open the Admissions Form I get a message box prompting me to "Enter Parameter Value" and the correct UniqueID is showing. I've done this a hundred times and have never had this stupid message box appear. How do I get rid of this? Thanks, Jordan.