Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2012

    Unanswered: Information is not showing up on form for me to update

    I have a form that I created and i have a text box on the form that will allow the user to enter the Retrieve Batch Number and if they hit the Find Record button this should show the information on the form that was entered. Under the Find Record button i have this query SELECT * FROM [CMAS-TEST] WHERE ((([CMAS-TEST].Batch_CMAS) Like [Forms]![Retrieve_Batch_CMAS]![Batch_CMAS] & "*")); however its working but not like i want it to work. What happen is when i enter the number in the Retrieve Batch Number and hit Find Record the database opens up and shows me the correct information but i want the information to show on the form. What I am doing wrong on this can someone help me?

    Thanking You in Advance for you assistance on this matter.

  2. #2
    weejas is offline Grumpy old man (training)
    Join Date
    Sep 2006
    Surrey, UK
    Provided Answers: 17
    The database is doing exactly what you've told it to do.

    If you want it to display the information from the query in a form, you need to bind the form to the query, and then refresh the form once the search term has been entered.

    An alternative method would be to use a subform to display the retrieved records. You can base the subform on the table concerned, and then clear its record source property before adding it to the main form. Your command button then needs to generate a SQL statement that looks like the one you've provided above, but with the value from the control rather than the control name. It uses the SQL statement to update the record source property of the subform, and refreshes the subform to show the data.
    10% of magic is knowing something that no-one else does. The rest is misdirection.
    Beers earned: 2

  3. #3
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    Another alternative would be to use a Combobx to select the Batch Number and leave all of the heavy lifting to the Access Gnomes! Here's a step-by-step:

    If you haven't already done so, create a form based on your table or query, including all the fields you want displayed. Then simply:

    Add a Combobox to your Form.

    The Combobox Wizard will pop up

    Select "Find a record based on the value I selected in my combobox."

    From the Table or Query the Form is based on, click on the Field you're searching by (the Batch Number Field, in this case) to move it to the right side.

    Hit Next.

    Size the column appropriately.

    Hit Next.

    Name the Combobox something appropriate.

    Hit Finish.

    Now you can drop the Combobox down and scroll down to the item to search by, or you can start to enter the item, and the Combobox will "autofill" as you type. Hit <Enter> and the record will be retrieved.

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts