Default value of Text field with selection of Combo Box

willbo987

Registered User.
Local time
Today, 09:57
Joined
Oct 30, 2012
Messages
43
Hi there.

In the database attached I have a form called frmCandidates.

In this form is a combo box where a user can select what company the candidate belongs too.

However some candidates are Private Individuals (do not belong to a company).

Therefore, I want the Position field to be set to 'n/a" by default if 'Private Individual' is selected.

Thanks for your help
 

Attachments

I'm pretty sure you've asked this question before (perhaps under a different alias). What happened in that thread?
 
Hi thanks for the response.
I misspelt the title and did not explain it very well so thought to start refresh attaching the database etc.
 
So what happened to the thread itself? You deleted it?
 
Hi again,

Yes I did thought it best rather than have multiple threads going.

This is where me and another user got so far,

In the event OnUpdate:

If me.CompanyName = "Private Individual" Then
me.Position = "n/a"
me.Position.setfocus
End If

But this did not work.
 
Yes I did thought it best rather than have multiple threads going.
That's not how things are done on this or any other forum! Threads should not be deleted if there's been at least one response. If you felt that you didn't explain yourself properly, then you could have given more context in a new post within the same thread.

That code should go in the After Update event of CompanyName.
 
Thank you for your response.

The code is indeed in the After Update event and does not work
 
CompanyName is a combo box and it's returning the numeric ID, so you test against that ID.
 

Users who are viewing this thread

Back
Top Bottom