Connecting Tech Pros Worldwide Forums | Help | Site Map

Difficulty with combo box selection

Mike
Guest
 
Posts: n/a
#1: Nov 13 '05
Hi

I have developed an application for data enty for daily production in
my factory.

I have one combo box for shits and second combo box for the "machine
names".
the third field on the form is the "production reading of the
machine".

My problem is that I want to enter data in the text field without
selecting the value for subsequent machines from the Machine name
combo box. When I select first machine on the start of data entry I go
to text field and enter the value. For subsequent entries I dont want
to select machines but want them to sequentially get selected and I
only enter data in text field for next machine.

I have only four fields in my Production table
Slno. number
shiftname text
machinename text
productionreading number


I have a separate table for machine name from where I populate the
combo box.

Please help..

Thanks

Mike

Bruce Dodds
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Difficulty with combo box selection


Mike wrote:[color=blue]
> Hi
>
> I have developed an application for data enty for daily production in
> my factory.
>
> I have one combo box for shits and second combo box for the "machine
> names".
> the third field on the form is the "production reading of the
> machine".
>
> My problem is that I want to enter data in the text field without
> selecting the value for subsequent machines from the Machine name
> combo box. When I select first machine on the start of data entry I go
> to text field and enter the value. For subsequent entries I dont want
> to select machines but want them to sequentially get selected and I
> only enter data in text field for next machine.
>
> I have only four fields in my Production table
> Slno. number
> shiftname text
> machinename text
> productionreading number
>
>
> I have a separate table for machine name from where I populate the
> combo box.
>
> Please help..
>
> Thanks
>
> Mike[/color]

After the user selects the first machine in the combo box, and has
entered the production reading for it in the text box, you might try
something like the following in the AfterUpdate event for the text box:

START OF CODE

Dim varItem as Variant

For each varItem in cboMachine.ItemsSelected
If cboMachine.ColumnCount - 1 > varItem then
cboMachine.Value = cboMachine.ItemData(varItem+1)
End If
End If

END OF CODE

This will select the next machine listed in the combo box.

If you look up ItemsSelected, ItemData, ColumnCount, and Value in Help
that willl give you a better idea of what's happening.

Good luck. If you have problems getting this to work, post your code.

(warning - I did not test the code above).



Mike Panwar
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Difficulty with combo box selection


Briuce,

Thanks for the suggestions.
I was able to solve the problem by changing the combo box to List box
and use the same code that you had provided.
I need to know How I can keep the focus on the machine name
automatically selected. Right now I don't know which machine is
currently selected as the cursor always remains in the production entry
(Text box).
Is there some work around on this...

Thanks

Mike



*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Closed Thread