code to fill in text box

BAzZ

Registered User.
Local time
Today, 22:10
Joined
Nov 13, 2002
Messages
60
Hope this is the right group,
I have a continuous form that has a 3 column drop down list box, on selecting a value from the drop down list it fills in two text boxes. This all works, my problem is: When I select a value from the list it fills in one of the text boxes, when this text box is a specific value I want another text box to fill in with specific text. The code I am using at the moment is this :

Private Sub TextBox1_AfterUpdate()

If Me.ComboBox.column(1)= "Specific Value" Then
Me.TextBox2.Value = "Specific Text"
End If

The TextBox2 value doesn't fill in unless I leave that record and then go back to it e.g. as this is a continuous form click on the record above or below and the click back in the record, and then it will update with the "Specific Text"
The above code is also in the Form_Current.

Thanks for any help
 
Thanks that worked a treat! But now, I want to be able to edit the text that autofills in, if I change the text and leave the record it reverts to the text that is in the code. Is there a way to change the text?
 
Anyone??!!

I have also added an Else to my code so now it looks like this:

Private Sub ComboBox_AfterUpdate()

If Me.textbox1= "Specific Value" Then
Me.Textbox2= "Specific Text"
Else
Me.Textbox2= Me.Textbox2
End If

this code is also in the Form_Current()

but I still can't get changes to the specific text to stick.
 
Please, someone I need this code, or for someone to steer me in the right direction urgently

Thanks
 
B,

Best guess on a Sunday: Perhaps you have some stray code that resets the value in the textbox: Check, among other places, in the AfterUpdate event of the textbox...

Regards,
Tim
 
you know what, that was a top guess!

Thanks heaps for that
 
Hi Bazz
Can you post your code here
I'm looking for something like this
Thanks
 
JPM, that was 6 years ago. You might do better by starting your own thread.
 
Your right ChrisO!!

I haven't used Access for about 4 years now, and I don't even remember which database that was from!

Sorry JPM :(
 
No Problem Guys
It's actually a javascript dropdown problem
I'm getting help somewhrere
Thanks
 
you know what, that was a top guess!

Thanks heaps for that

Best response on a Sunday a little less than six years later: You're welcome.

Regards,
Tim
 

Users who are viewing this thread

Back
Top Bottom