Page 1 of 3 123 LastLast
Results 1 to 15 of 37
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    St. Charles, Illinois
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    combo box on forms (Access 2000)

    I am 90% done with the database and now I am making the form. I know how to make a combo box. I want the first field on the form to be the customer's name displayed as a combo box. Once the customer is selected I want all of the data on the form to be relative to the selected customer. How do I do this? Thank you.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: combo box on forms (Access 2000)

    The easiest way to create such a combo box is through the combo box wizard.
    - Open the form in design view.
    - Make sure that the Control Wizards button on the Toolbox is "on" (it is the second button on the Toolbox, and it looks like a magic wand with some stars)
    - Put a combo box on your form; this will start the Combo Box Wizard.
    - Select the third option, then click Next and follow the instructions.

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    St. Charles, Illinois
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: combo box on forms (Access 2000)

    Thank you. I am very close. When I followed your instructions I received this error, "The Expression After Update you entered as the event property setting produced the following error: Error Accessing file, Network connection may have been lost" I am not on a network and I did not set any property. What should I do?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: combo box on forms (Access 2000)

    When did you get the error? While you were followong the steps of the Combo Box Wizard, or when you clicked Finish, or when you tried to use the combo box? Does the problem persist after closing and reopening the database?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: combo box on forms (Access 2000)

    Addition: see if the conditions described in MSKB article ACC2000: Error Message: Error Accessing File. Network Connection May Have Been Lost apply to your computer. The article mentions several workarounds.

  6. #6
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    St. Charles, Illinois
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: combo box on forms (Access 2000)

    Thank you. I think this is the solution to some other error messages that keep re-occurring.

  7. #7
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    St. Charles, Illinois
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: combo box on forms (Access 2000)

    Thank you. I learned two things from this article. The error message about the network and previous error messages were corrected by changing HasModule to No. I still created a new data base and used the import feature to clean up any other problems. This was extremely easy and fast. Now another problem. One of my reports is emulating a check. I have everything done except I can't get the numbers to convert to text. I read a previus article from Microsoft about converting currency to English in a module. However, because of my previous problems with modules, is there just a line of code that can be used instead of a module? Thank you.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: combo box on forms (Access 2000)

    I am afraid that converting numbers to text ("twenty five dollars and thirty seven cents") is too complicated to handle in an expression, you need code for that. But according to the MSKB article, it should be OK if you create the module with the number-to-text function, then select Debug | Compile <project> before closing the database.

  9. #9
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    St. Charles, Illinois
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: combo box on forms (Access 2000)

    Thank you, I will try this.

  10. #10
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    St. Charles, Illinois
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: combo box on forms (Access 2000)

    Now that the data base is working with no error messages, I am back to creating the combo box that bring's up the customer's name relative to the form. It worked the first time, however when I went back in it did not work. If I chose a customer's name that customer's name stayed on the form, no matter what record I was on. It seems to me there needs to be a code in the recordsource line. Please help. By the way, I find Access to be quite unreliable, unlike Excel. These error messages should not have occurred. Do you and others find weird stuff happening in Access for no obvious reason? Thank you.

  11. #11
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: combo box on forms (Access 2000)

    No, I don't find Access unreliable. However, it is far less an end-user tool than Excel and is more complex, plus requiring a basic understanding of relational design if you want it to work properly. There are bugs in Access, just as there are in Excel, Word and the rest of software from any vendor. The purpose of the knowledgebase is to help you identify the problems those bugs might cause and find a way around them, at least until the publisher comes up with patches or service packs to fix the bugs.

    If your combobox is one designed to find a record for you, then it is working properly. It will not automatically change to a different record information unless you build code to make it behave that way, and why would you do that if the purpose of the combobox is to find a record? The simplest way around this is to set the value of the comobox to null after you locate the record. That way, it doesn't appear incorrect and is ready to use for finding another record when you wish. It has nothing whatsoever to do with *navigating* between records, only with finding a specific one. There is no reason to play with the recordsource of the form unless you want only a single record available and in that case, the problem doesn't apply.
    Charlotte

  12. #12
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: combo box on forms (Access 2000)

    If you don't already have Service Release 3 for Office 2000 on your machine, apply it. That corrects the problems arising from the difference between vbe6.dll versions installed by Office 2000 and any of the XP applications and you shouldn't have to go to such lengths to recover a database in the future.
    Charlotte

  13. #13
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    St. Charles, Illinois
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: combo box on forms (Access 2000)

    Thank you. I am trying to use the combo box to navigate through the records. When using the combo box wizard I chose option 3 to make the data relative to the combo box. That way if the user knows the customer's name, they can jump right to the data. In properties, do I go to 'After Update' and type in Null? Thank you.

  14. #14
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: combo box on forms (Access 2000)

    I haven't made myself clear. You navigate through the records by moving forward or back to the next or previous record. The Combobox has nothing to do with that. You make a specific selection in the combobox, and the form moves to that record by finding it in the recordset and then moving the form's bookmark pointer there. Clearing the combobox requires additional code in the AfterUpdate event code of the combobox. One you have tested to see if the record is found, simply set the value of the combobox to null in the next line of code.
    Charlotte

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: combo box on forms (Access 2000)

    You don't type Null in the After Update event. You click in that event, then click the ... to the right of the dropdown arrow. This will take you to the Visual Basic Editor. There will be code for the event already, created by the Combo Box Wizard. Just above the End Sub for the procedure, insert this line:

    Me.cboSomething = Null

    where cboSomething is the name of the combo box.

Page 1 of 3 123 LastLast

Posting Permissions

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