Unbound TextBox Control doesn't start the MainForm search

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NerdyGirL
    New Member
    • Feb 2008
    • 2

    Unbound TextBox Control doesn't start the MainForm search

    Hello,
    I've read thru numerous post/archives trying to decipher the cause of my problem to no avail. I'm just basically trying to conduct a search by using a form in order to locate data that may or may not be in one field of an associated table/query. Here's my 3-step process.
    1) I click on the name of my Main form (that I've already created along with a subform and query and an click-on command button) and it prompts me with an "Enter Parameter Value" diablog box. 2a) If I enter a username that I know is there, the Mainform appears with data results only populated in the Subform area (nothing gets populated in the Unbound TextBox control area). 2b) If I enter a username that I know is NOT there, it returns a data entry screen with all fields blank (empty) or it clears out the previously populated subform area conducted by a previous search, which is fine. 3) When I try to conduct my second username search (on a different and known username) from within this MainForm/Subform area by entering data in the Unbound TextBoxControl field and clicking on my customized Command button, I am then prompted again (just like in step1) by the "Enter Parameter Value" dialog box so that I can re-enter the data that I just tried to enter in the Unbound TextBoxControl.

    The search does retrieve the appropriate data but I have to initiate the search in such an awkward two-step manner that it makes me wonder why I even need the UnboundTextBox Control in the first place.

    Any suggestions would be greatly appreciated.
  • puppydogbuddy
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    Originally posted by NerdyGirL
    Hello,
    I've read thru numerous post/archives trying to decipher the cause of my problem to no avail. I'm just basically trying to conduct a search to locate data that may or maynot be in one field. Here's my 3-step process.
    1) I click on the Main form and it prompts me with an "Enter Parameter Value" diablog box. 2a) If I enter a username that I know is there, the form appears with data results only populated in the Subform area (nothing in the Ubound TextBox control). 2b) If I enter a username that I know is not there, it returns a blank screen or clears out the previously populated subform area, which is fine. 3) When I try to conduct my second username search (on a different and known username) from within this MainForm/Subform area using the Unbound TextBoxControl and clicking on the Customized Command button, I am then prompted by the "Enter Parameter Value" dialog box so that I can re-enter the data that I just tried to enter in the Unbound TextBoxControl.

    The search does retrieve the appropriate data but I have to initiate the search in such an awkward two-step manner that it makes me wonder why I even need the UnboundTextCont rol box in the first place.

    Any suggestions
    It would be helpful if you posted your search query. Nonetheless, here are two possibilities to look into:
    1. In your search query, there should be a reference to the unboundTextCont rol box..
    "Select username, blah, blah From YourTable Where UserName Like '" & UnboundTextCont rol & "'"

    2. Even if you are referencing the unboundTextCont rol box correctly in your query, Access often wants the parameter declared. To declare your parameter, place the query in design view; goto Access command menu; click query button, then select parameters to get the parameter dialog box.

    Hope this helps.

    Comment

    • NerdyGirL
      New Member
      • Feb 2008
      • 2

      #3
      Originally posted by puppydogbuddy
      It would be helpful if you posted your search query. Nonetheless, here are two possibilities to look into:
      1. In your search query, there should be a reference to the unboundTextCont rol box..
      "Select username, blah, blah From YourTable Where UserName Like '" & UnboundTextCont rol & "'"

      2. Even if you are referencing the unboundTextCont rol box correctly in your query, Access often wants the parameter declared. To declare your parameter, place the query in design view; goto Access command menu; click query button, then select parameters to get the parameter dialog box.

      Hope this helps.
      Thanks for the advice. I had not made reference to the UnboundTextBox Control in the query at all...i'll give that a try and keep you posted. Thanks again.

      Comment

      Working...