vba assign textbox controlsource

rdulanski

New member
Local time
Today, 09:49
Joined
May 29, 2013
Messages
6
I am working with textbox [DispCD] (a date field) on form [Contract]. There is a dropdown on combobox [Searchbox] for selecting the desired record. I am writing VBA in the [Searchbox] OnChange event.

The control source for [DispCD] would normally be "=Searchbox.column(11)". If "column(11)" has a date, I want [DispCD] to show that date and then be locked. If "column(11)" does NOT have a date, I want [DispCD] to allow entry of a date with the date picker showing. I've tried to assign the control source to [DispCD] with this:

CSVal = Format(Forms![Contract]!SearchBox.Column(11), "ddd m/d/yyyy") (this works)
If CSVal = "" Then _
Forms![Contract]!DispCD.countrolsource = "=SearchBox.Column(11)"
I get "Object doesn't support this property or method" error.

What am I doing wrong ?
 
Spelling control wrong for starters. ;)
 
Can you post (zip) a copy of your database? Remove anything private/confidential.

What is your experience level with database? Access? VBA?
 
That didn't make you look at your code?

Forms![Contract]!DispCD.countrolsource = "=SearchBox.Column(11)"
 

Users who are viewing this thread

Back
Top Bottom