combobox format

L

lilachd

Hi.
I am using a excel form and in the form I have a combobox that get Date list
from a range in the worksheet.
after yhe user choose the date I want to change the format (for the sql
query).
I try this:
ChoosenMonth = Format(CmbMonth.Value, "YYYY-MM-DD")
but it's not working.
Please help me,
thanks lilach
 
R

Richard Bond

Put a breakpoint at this position:

ChoosenMonth = Format(CmbMonth.Value, "YYYY-MM-DD")

and check the value of

CmbMonth.Value (The format function will work with dates expressed as
numbers e.g. 38698 and date strings like 12/12/2005 probably format dependent
to a certain extent)

As you don't give many details of the error it could even be that you have a
type mismatch i.e. ChosenMonth should really be a string

cheers,

Rich
 

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

Top