stLinkCriteria

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:

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.

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

First issue I see is the possibility that Me![UniqueID] is NULL. Even if it should never be NULL, it's always a good idea to check for it. Users are notoriously ingenious in finding ways to do things they "can't" do. :)

' The -1 value is just arbitrary...you can make it whatever you want.
stLinkCriteria = "[UniqueID]=" & NZ(Me![UniqueID],-1)

I also agree with Emanon that you should remove the default value assignment from the [UniqueID] control on the Admissions form. By setting the link criteria, you are effectively telling the Admissions form that no other [UniqueID] value should be available.

For troubleshooting, I suggest putting a breakpoint in the OnLoad event of the Admissions form, or in the OnClick event for the command button on the main form. This way you can check the value of stLinkCriteria during execution to verify its validity. Also, your code assumes that [UniqueID] is a numeric value. Finally, please detail the title bar and text on the prompt you receive. It will tell us what parameter it thinks it needs, and may provide a clue as to the source of the error.

Thanks for looking at this routinet. The UniqueID isn't null. The way this is filtered from Clients to Admissions there shouldn't be any other UniqueID available except the one showing on the Clients Form when the Admissions Form is opened. What you said about the code assuming that the UniqueID is a numeric may be the problem. The UniqueID is a generated field that is a text. It contains first letter of the last name and first letter of the first name. In the past I have used text fields in this manner but they've only contained numbers. An example of a UniqueID is "M04N61225". The exact prompt that I get (if that exact UniqueID was showing is):

Enter Parameter Value (Blue part of msgbox)

M04N61225 (Right above text box)

When I click ok it's at that exact UniqueID anyway. You probably have a good idea of what I'm doing wrong now. Thanks

The problem is that Access needs a text string for the parameter. By not putting the single-quotes around your value, you imply that M04N61225 is a user-provided value to match, and Access in turn asks for it.

Featured Post

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications. You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.

In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another.
Base the dependent combo on a query for its row source:
Add a reference to the first combo on the form as criteria i…

With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …