Results 1 to 8 of 8
  1. #1
    Carmine is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Apr 2019
    Posts
    11

    Open form with text box blank


    THE SITUATION: I have a form that contains a combo box and a text box. The purpose of the form is to correct data misspellings or inaccuracies in a table, call it the “NameTable”. This is limited to only one NameTable field, “PartName”. When the combo box is activated and a PartName selection is made, that PartName appears in the text box. The user can then make corrections and save then them. This situation works perfectly.

    THE PROBLEM: When the form opens, the combo box is blank, but the text box contains the first PartName in the NameTable.

    WHAT I WANT: When the form opens, the combo box is blank, but I want the text box also to be blank, that is until a combo box selection is made, then the user can make corrections and save them.

    Thanks in advance,

    Carmine

  2. #2
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,821
    Hi Carmine

    Can you upload a copy of the Database with no confidential data?

  3. #3
    davegri's Avatar
    davegri is online now Excess Access
    Windows 11 Office 365
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    You will need to make the textbox unbound.
    The after update event of the combox can populate the textbox.
    The after update event of the textbox will need to trigger an update query to update the correct record in NameTable with the contents of the textbox.

  4. #4
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    566
    Quote Originally Posted by Carmine View Post
    THE SITUATION: I have a form that contains a combo box and a text box. The purpose of the form is to correct data misspellings or inaccuracies in a table, call it the “NameTable”. This is limited to only one NameTable field, “PartName”. When the combo box is activated and a PartName selection is made, that PartName appears in the text box. The user can then make corrections and save then them. This situation works perfectly.

    THE PROBLEM: When the form opens, the combo box is blank, but the text box contains the first PartName in the NameTable.

    WHAT I WANT: When the form opens, the combo box is blank, but I want the text box also to be blank, that is until a combo box selection is made, then the user can make corrections and save them.

    Thanks in advance,

    Carmine
    Neither here nor there answer, but if you can find all the misspellings and add them to a table, you can add a column to it and add another column and add the correct spelling. Then you just do it once.

    UPDATE MyTable mt
    SET mt.[ValuesSpelledWrong] = ct.[ValuesSpelledRight]
    WHERE mt.[ValuesSpelledWrong] = ct.[ValuesSpelledWrong]

  5. #5
    jojowhite's Avatar
    jojowhite is online now Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    434
    On the Load Event of the Form, use DoCmd to GoTo New Record.
    When a selection is made on the combobox, you Search it on the form:

    Code:
    Private Sub Form_Load()
    'goto new record so textbox is empty
    DoCmd.GoToRecord , , acNewRec
    End Sub
    
    Private Sub Form_AfterUpdate()
    'refresh combobox
    YourCombobox.Requery
    End Sub
    
    Private Sub YourCombobox_AfterUpdate()
        If YourCombobox.ListIndex <> -1 Then
            DoCmd.SearchForRecord , , acFirst, "PartName='" & YourCombobox & "'"
        End If
    End Sub

  6. #6
    XeviBatlle is offline Novice
    Windows 11 Office 365
    Join Date
    Aug 2025
    Posts
    3
    Perhaps an easy solution is to set the text box unbound until the combobox is filled. I mean to set the textBox controlsource to Null in dessign mode and assign it in the AfterUpdate() combobox event.

  7. #7
    Join Date
    Sep 2025
    Location
    Newport, Shropshire, UK
    Posts
    20
    I would suggest that you base the form on a query which references the unbound combo box, in the form header section, as a parameter on the PartName column: Nz(Forms!NameOfForm!NameOfComboBox,"") The form need only return the PartName column in a bound text box. When the form opens, the combo box will be Null, so the form will return no rows. In the combo box's AfterUpdate event procedure requery the form with Me.Requery to return the rows which match the value selected in the combo box. You can then correct the value. In the text box's AfterUpdate event procedure requery the form. The corrected row will be dropped from the form's recordset. The text box will continue to return any more incorrect values which match that selected in the combo box. Once all such values have been corrected the form will return no rows, and another value can be selected in the combo box.

  8. #8
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    If you referred to a column in the combo by the control, surely that would be empty as well?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 01-31-2018, 04:06 PM
  2. Advise needed blank database or blank Web Database
    By Derrick T. Davidson in forum Access
    Replies: 0
    Last Post: 04-25-2013, 09:13 PM
  3. Replies: 11
    Last Post: 11-28-2012, 04:29 PM
  4. Replies: 4
    Last Post: 05-11-2011, 03:06 AM
  5. Replies: 1
    Last Post: 09-05-2008, 12:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums