• Microsoft Access 2010 issue with getting data from a field for an expression
    0 replies, posted
So I have two forms. One form shows the details of a past transaction, and on that form is a button that should open another form which shows details of the customer. The problem is that I can't get this button to work, and using the default expression that Access creates only shows an empty customer detail form. The past transactions form has a 'customer' field and the customer detail form has a 'customer name' field, which I've made a relationship with. I created a button which uses the 'Open Form' command to open the customer details form, and I set it so that it opens the form to find specific data. I selected the 'customer' and 'customer name' fields from each respective form as being matching data to use to look up information. But when I actually click the button, it opens the customer details form, yes, but all the fields are empty. I assume this is because of an error where the expression input doesn't find a matching value from the customer details form, which is why it wont display information. I assume this because Access created the following retarded expression in the expression options stuff for the button's Open Form command: ="[Customer Name]=" & "'" & [Customer] & "'" I've done two years of programming and I cannot understand how that is acceptable syntax for a where argument. I messed around with the expressions, and tried, for example: [Customer] = [Customer Name] However, this doesn't take the value from the customer field and instead prompts me to enter my own value. If I enter my own value of a customer I have in my database, it opens the customer details form and all the data is there - works perfectly. But I don't want to have to type the customer name, I want Access to get the input from the customer field. Also trying something like [Customer].[Text] = [Customer Name] doesn't help because it then asks me to enter a value for [Customer].[Text]. [B]TL;DR[/B] How do I create an expression to extract a value from a field without being prompted by Access to enter an input myself? [editline]12th May 2014[/editline] This tutorial is exactly what I need to do [url]http://www.599cd.com/blog/display-article.asp?ID=742[/url] but when I click my button to open the other form, the fields are all empty.
Sorry, you need to Log In to post a reply to this thread.