• self store on combo (A2k)

    Author
    Topic
    #361451

    Hi

    Could somebody tell me how to make a combo box on a form that retains a value that is typed into it for future use on other forms, i.e. self learning and not linked to another table.

    Thanks

    Steve

    Viewing 0 reply threads
    Author
    Replies
    • #546341

      Hi Steve,
      Can you elaborate on what exactly you’re trying to achieve by this? There may be an easier way of getting what you want.

      • #546344

        Hi Rory,

        I have a job sheet form that people need to enter information into all day, a number of the fields contain 1 line entries, I originally considered setting up tables such as employee’s names, carton type etc. etc. but in other posts I have seen here it is encouraged to have many tables but discouraged to have them with just 1 field.

        I then thought that if I had a combo box that automatically stored new unique records it would do the trick. I know how to leave form 1, make a new reocrd in a form 2, return and use the information in form 1 but this would be cumbersome with the amount I am talking about.

        Somebody with heaps more knowledge than me just said “Recursive Join” but would not elaborate at all.

        Thanks for any help

        Steve

        • #546348

          It’s nice when people are helpful like that! To be honest I’m not sure how a recursive join would help here, but then I’m still a little confused as to what you’re trying to do.
          I suspect that you do indeed want tables such as Employees set up. Such tables can have as few as 2 fields (eg employeeID, employeename) – there’s not a lot of point in having a 1 field table since in order to link it to any other table you’re including all the data from the table anyway!
          I think what you need to look at is probably the NotInList event. If your combobox retrieves data from a table or query (eg employees, carton type etc) and its LimitToList property is set to true, the NotInList event occurs if a user types in a new value. You can use code in the event procedure to add the new item to the underlying table so that it will be available in the combobox in future.
          Does that sound like what you’re after?

          • #546532

            Maybe I have confused you, put simply all I want to do is have a combo box remember a value once it has been entered. If a new form is opened the combo will still have thats value among its stored entries so the user just has to select it from the drop down.

            Initially I made tables such as CartonID, CartonType but this would not let me change the property from Yes to No because it says the first field property cannot be 0 (when I set up the combo I ask the lookup to hide the Primary Key so I get 0″;1″). I then deleted all the Primary Keys and made the actual item (for example CartonType) as the primary key, because these values would always be unique I did not see a problem with that. I can now set the property to No and I can type in any value I want but it does not save it.

            Hope this explains better, thanks so far.

            Steve

            • #546786

              Hi Steve,
              I’m attaching a zipped database which I hope is along the lines you’re talking about – there’s one form which has 2 comboboxes on it (employees and cartons) which lookup their values in 2 tables. If you type a new item in either of them, it will ask if you want to add the new item and then insert that item into the table without leaving the form. Is that what you’re after?

            • #546787

              As an addendum to my last post, you could make the add new item process into a generic function by passing it the names of the table and field to add to if you have a lot of comboboxes to do this to. It’s not necessary but it might make for easier maintenance!
              Hope that helps.

            • #546908

              Thanks Rory that is perfect as is.

              Steve

    Viewing 0 reply threads
    Reply To: self store on combo (A2k)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: