Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

combo box

PacificbondPacificbond Member Posts: 2
I am using a combobox to select a client.
I then want to input (say) a dozen records all for that one client.
How do I retain the selected client so that I don't have to re-drop the box everytime and click on that client.
I've tried using the .itemdata() property but cannot find out how to save the index to feed it back in as the default. For instance if the selected client is at 5 in the list how do I retrieve and save the 5.
Alternatively, can I use a text box or a field in another table or query to save the itemdata(index)?
Any help will be most appreciated as after 20 hours of experimenting I'm no further forward and my code is somewhat cluttered!
Thanks, Roger

Comments

  • nneomanneoma Member Posts: 61
    try this out. place a text box on the form and set its visible property to false. save the index of the combo in the text box and feed it back to the combo from there. in other words, the click event of the combo box will populate the text box. when the data is saved, the event implementing the save then resets the combo box with the index saved in the text box. pls let me know if this works. i'm 95% sure it would.

    : I am using a combobox to select a client.
    : I then want to input (say) a dozen records all for that one client.
    : How do I retain the selected client so that I don't have to re-drop the box everytime and click on that client.
    : I've tried using the .itemdata() property but cannot find out how to save the index to feed it back in as the default. For instance if the selected client is at 5 in the list how do I retrieve and save the 5.
    : Alternatively, can I use a text box or a field in another table or query to save the itemdata(index)?
    : Any help will be most appreciated as after 20 hours of experimenting I'm no further forward and my code is somewhat cluttered!
    : Thanks, Roger
    :

  • PacificbondPacificbond Member Posts: 2
    [b][red]This message was edited by Pacificbond at 2006-11-24 14:1:43[/red][/b][hr]
    Thanks for the tip.
    I still can't get a solution that works.
    What I think I need to know is the code or macro or event that can get the current value of the index. Viz, I need to be able to get the value of "n" in [comboboxname].ItemData(n) - if you can give me some code for this then I think I'm away!
    Thanks
    Roger
    : try this out. place a text box on the form and set its visible property to false. save the index of the combo in the text box and feed it back to the combo from there. in other words, the click event of the combo box will populate the text box. when the data is saved, the event implementing the save then resets the combo box with the index saved in the text box. pls let me know if this works. i'm 95% sure it would.
    :
    : : I am using a combobox to select a client.
    : : I then want to input (say) a dozen records all for that one client.
    : : How do I retain the selected client so that I don't have to re-drop the box everytime and click on that client.
    : : I've tried using the .itemdata() property but cannot find out how to save the index to feed it back in as the default. For instance if the selected client is at 5 in the list how do I retrieve and save the 5.
    : : Alternatively, can I use a text box or a field in another table or query to save the itemdata(index)?
    : : Any help will be most appreciated as after 20 hours of experimenting I'm no further forward and my code is somewhat cluttered!
    : : Thanks, Roger
    : :
    :
    :



Sign In or Register to comment.