Hi Al,
Thanks for your response,
the listbox doesn't contain the record data, only the field name, what i would like to
know is, if the datatype of the selected field is text, only show one textbox, if it is
a date, show both textboxes, the idea bieing to allow for a date range in the query
which reads the textboxes.
i hope this makes sense, thanks
Andy (Visita Eastbourne)
Vivista,
This is a bit odd... A listbox will always return the value of the first column. If
that listbox column contains text ("ABCD...") and is mixed with what look like dates
(01/01/06)... then those aren't really DateType... they are just text. A column can't
hold both Text and Date Types.
If your Text entries (other than the psuedo dates) have no "/" character in them,
then you could use the AfterUpdate event of Lst1 to determine if the text selected
"looks like a date."
Private Sub Lst1_AfterUpdate()
If InStr([Lst1],"/") <> 0 Then
TextSearch1.Enabled = False
TextSearch2.Enabled = True
Else
TextSearch1.Enabled = True
TextSearch2.Enabled = False
End If
End Sub
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
Hi,
I have a listbox lst1 which contains field values of tbl1
I have txtsearch1 and txtsearch2 textboxes
How do I only enable txtsearch2 when the field data type chosen in lst1 is a
time/date type.
ie. if lst1 datatype = "date/Time" then txtsearch.visible = True
something like that
please help
Many Thanks
A