Help - Need Selection on List Box Populate field on Form

cinders

Registered User.
Local time
Today, 09:50
Joined
Aug 28, 2001
Messages
48
Hi There,

I have a form with an unbound text box called TrkID. When the user double clicks in the TrkID text box, I want another form to open that contains a list box. From that list box the user makes a selection that will then populate TrkID on the original form. The user also needs the capability to not have to double click and make a selection. If the user already knows the values that are available in the list box, they can just type the value in. My problem lies in making a list box that will then populate the unbound text form on the main form.

Can anyone help??

Thanks

Cindy
 
List Box

You could make the TRKID field on the Main Form a listbox, so you don't have to go to a seperate form.

But if you still want to do that you can build a form with a list box.
When the user dblclicks (or clicks) in the desired field its value is inserted in the appropriate field of the main form.
Put this code in the On DblClick Event (or Click) of the field in the listbox:

Forms!MainForm.TrkID = Me.TrkID

If you ad:
DoCmd.Close

the form with the listbox will close after the dblClick
 
Cindy,

Are you really sure that you want a "bound" listbox (except for the NotInList) and
an "unbound" form?

What are you going to do with the form's unbound data?

A bound form will let Access take care of all of the retrieval, display and
maintenance of the data. You will only have to make "unbound" combos and
listboxes to control the selection of data. There are some samples of this
in the Sample Database Forum here.

Wayne
 
The unbound forms feeds subsequent forms. I don't want them bound to a table at this point, as they should not be updating the table until later on, there is a whole lengthy explanation behind this, one of which it is a database that is I am replicating for training purposes, it needs to "appear" to function the same as the live application, but doesn't really capture anything. It is for practicing input. I've had to manipulate things a great deal to get it to emulate the live system. In the "live" system the user can input a value into the Truck ID field OR if they don't know, when they double click in the field a pop-up box appears with a list of values. When they select the value it closes the pop-up box and populates the Truck ID field.

I hope that helps and makes a little more sense. I really HAVE TO approach it this way, because it is emulating an existing system.

Anymore feedback would be greatly appreciated.

Thanks

Cindy
 
Cindy,

You can approach this with "bound" forms. You can open a form with the
attributes "ReadOnly". You can use unbound combos and listboxes to let
you navigate through the data.

Even though you can't change it, you can control how they access it!

Wayne
 
Thanks a Bunch

It took me a long time to get around to trying your suggestions, but I finally got to it and it worked!!! Thanks. :) :D :) :rolleyes:

Cindy
 

Users who are viewing this thread

Back
Top Bottom