Using combobox to repeat data to next record

  • Thread starter Thread starter Alex Martinez
  • Start date Start date
A

Alex Martinez

Hello,

I have a form with a search box, when I type in a policy number the policy
number will appear in the txt box next to my search box. For every new
record I will assign a user thru the combobox, but I want to do some sort of
batch process. For example - I like to continue to search for the policy
and assign a user to the policy number, but continue to search for more
policy using the same previous assigned user. I was think maybe I can have a
some sort of command but that will retain the assigned user until I press it
again. The problem is I may have about hundred policies to assigned and
keep assigning the user thru the combobox can be a pain. Any tips or websit
to vist, please let me know. Thank you in advance.
 
Hi Alex,

I'm not sure which of two things you want. Is it

(a) You select a user from a combo box on one record. The same user
subsequently appears as the default choice when you create a new record.

or

(b) You select a user on one record. You want an easy way to set the
same user after you've scrolled to another (new or existing) record.


If (a): put a line of code in the combobox's AfterUpdate event that sets
its DefaultValue, e.g.:
Me.ActiveControl.DefaultValue = Me.ActiveControl.Value

If (b): put code in the combobox's AfterUpdate event that stores its
current value, and have a commandbutton on the form that retrieves the
stored value to the combo's Value property.

You can store the value in a variable declared at module level in the
form's code module, or in a text box with its Visible property set to
false: but in that case the stored value is lost when you close the
form. To have the stored value persist between uses of the application,
you need to store it in a table (many databases use little tables to
store these and other user-related settings).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top