Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting the rowsource of a cbo with months instead of dates.

Status
Not open for further replies.

Rmck87

Programmer
Jul 14, 2003
182
US
Alright this is the code that i am using to convert the numerical date to the text month of a column in table p.

Format([p.date_start],'" & mmmm & "')

But, whenever i try using this same code to set the Row source for a combo box so i get the months to come up, it seems to have a problem reading another table, is there a problem with using this format in the rowsource of my cbomonth combobox?

One Ring to Rule Them All, One Ring to Find Them, One Ring to Bring Them All, and in the Darkness Bind Them.
 
try this...

insert this in the rowsource:

SELECT [p].[date_start], Format([date_start],"mmmm") AS [Month] FROM p;

you may need to set column count to 2
and want column widths to 0";1"

the 0" suppresses original date format so it's not viewable by user

hope this helps you.
 
Ok, lets say i need to change the rowsource constantly? And i need to put this stuff into the code of my form. How do i code the ' "mmmm" ' part. because with the quotes it calls that it should be the end of statement should i use & ? or how else should i do this?

One Ring to Rule Them All, One Ring to Find Them, One Ring to Bring Them All, and in the Darkness Bind Them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top