CODE ERROR

G

Guest

i have typed the following code in the AfterUpdate of a combo box in a form:

Private Sub textboxname_AfterUpdate()
Me!textboxname.DefaultValue = Chr(34) & Me!textboxname & Chr(34)
End Sub

my aim is that the paricular field is automatically filled in when i type
data prevously inserted in the field (like excel does). but the code is not
working and i get an error message. what could i be doing wrong?
 
D

DubboPete

just an amateur suggestion, but take out 'default' from 'defaultvalue'
so the second line reads...

Me!textboxname.Value = Chr(34) & Me!textboxname & Chr(34)

or in full context

Private Sub textboxname_AfterUpdate()
Me!textboxname.Value = Chr(34) & Me!textboxname & Chr(34)
End Sub

hope it works, it's a guess!

DubboPete
 
G

Guest

"Complile Error: Syntax Error"

Ο χÏήστης "Douglas J. Steele" έγγÏαψε:
 
D

Douglas J. Steele

I don't see anything obviously wrong with what you've got.

You're positive that's the line of code that's causing your problem?
 

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

Similar Threads


Top