Combo Box actions

Len Boorman

Back in gainfull employme
Local time
Today, 20:46
Joined
Mar 23, 2000
Messages
1,927
The On Click Event Procedure for a combo box on a form is as below

cbo_NHA = cbo_FFC.Column(1)
cbo_NHA_Effect = cbo_FFC.Column(2)
cbo_NHA.Locked = True
cbo_NHA_Effect.Locked = True
Basically this works fine but
The Limit to list is set to No since it is possible that a new value for Column(0) will be required. Column(0) is the bound column.

So what I actually want to do is

If User selects from list then carry out actions as above

Else Just accept the User new value input to the combo box and do nothing else.

Hope someone out there can help.


Len B
 
Len,

I do something very similar for all my Town State PostCode entries.

I use multiple events to control the flow of operations.

See if you can make sense of the following:

Code:
Private Sub CboTown_AfterUpdate()
Me.Town = Me.CboTown.Column(1)
Me.State = Me.CboTown.Column(2)
Me.PostCode = Me.CboTown.Column(3)
End Sub

Private Sub CboTown_KeyDown(KeyCode As Integer, Shift As Integer)
Me.CboTown.Dropdown
End Sub

Private Sub CboTown_NotInList(NewData As String, Response As Integer)
Response = acDataErrContinue
Me.Town.Enabled = True
Me.State.Enabled = True
Me.PostCode.Enabled = True
Me.Town = NewData
Me.CboTown = "Not In List"
Me.Town.SetFocus
End Sub

CboTown is the name of the Main Combo
Town / State / PostCode are all text boxes (Disabled by default)

Sorry I can't elaborate further, but I am in need of a beer, and after all, it is Friday arvo here.

Cheers

Brad.
 
Brad

Friday Morning here so no beer for a bit.

Thanks for offer. Think I understand it

Have a beer for me

Len
 
I have finished my beer Len.

I am enjoying yours now :)
 
Ahhhh, That was the last of your beer Len.

Now, who else's beer can I drink????
1drink.gif
 
Some of us are still working

Code nearly works

If I select from list all okay.

Enter new data to combo (Not in list) will not unlock the other fields at the moment.

But don't let that disturb the flow of beer. Huh

Len
 
No, It's OK, I have just been to the fridge.

Restocked and ready to go.

I assume you have adjusted my code to allow for the fact that my fields were disabled (enabled = false initially. Becomes enabled = true on Not In List event)

(You of course will need to change the enabled = true to locked = false)

Gulp. Must stop typing, need a drink ;)

Brad
 
Have set cbo_NHA and cbo_NHA_Effect Locked=true


Private Sub cbo_FFC_AfterUpdate()
cbo_NHA = cbo_FFC.Column(1)
cbo_NHA_Effect = cbo_FFC.Column(2)
End Sub

That bit no probs

Private Sub cbo_FFC_KeyDown(KeyCode As Integer, Shift As Integer)
Me.cbo_FFC.Dropdown
End Sub

Same here

Private Sub cbo_FFC_NotInList(NewData As String, Response As Integer)
Response = acDataErrContinue
cbo_NHA.Locked = False
cbo_NHA_Effect.Locked = False
cbo_NHA = NewData
cbo_NHA_Effect = NewData
Me.cbo_FFC = "Not in List"
End Sub

If I enter a "not in list" response" it is accepted okay but the two combo's are not unlocked.

Using Access 97 and Best Bitter

Len
 
Is there a need to have the 2nd two NHA's as combos ??

If not (ie: you are only using them to display Column(x)) then I would change them to TxtBoxes.

Hmm, office fridge is looking empty.

Might have to go home. But wife is at home????? And PUB is closer. . . . . Dilema number 63 for today.

Brad.
 
Will play about changing to text boxes

I know it sounds daft but need one NHA for a code and second NHA for the code description.

Aha you say Normalisation

but spec says that a code can have more than one description.

All to do with Failure Mode, Effect and Criticality Analysis on a multi structure level assembly.

Same code can appear at different analysis structure level with different description.

Bit of a bitch really but that's what is wanted and its non negiotable



Office Fridge !!!!!

Have a good weekend

say hello to the wife

Len b
 

Users who are viewing this thread

Back
Top Bottom