Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

expression either by month number or mmm?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KarenY - 17 Nov 2005 13:04 GMT
I have a field called AcctgMonth with 2 columns (combo box: column 1 = Jan
...till Dec; column 2 = 01... till 12) and I have an expression for users to
enter month (mmm), it works out fine to pull out the data pertaining to the
entered month.
It doesn't work if it's entered month number which is in the 2nd column of
the combobox.

Actually the users want to enter either month number or month alpha (mmm)
when my parameter box pops up with the criteria : [Enter your month:]
Is there a way to have the expression to get either month number or mmm ?

Anybody please help?

thanks
Karen


Ofer - 17 Nov 2005 16:34 GMT
Hi Karen

In a query, you can try this
Select * From TableName Where DateStr = [Enter your month:]  Or DateNum =
[Enter your month:]

About the combo, it's more complicated.
When I needed to do that, I created two combo's
1. To select one field
2. To select by the second field
They both bound to the same field in the table,  so when you select in one
combo it will update the second combo

Signature

I hope that helped
Good Luck

> I have a field called AcctgMonth with 2 columns (combo box: column 1 = Jan
> ...till Dec; column 2 = 01... till 12) and I have an expression for users to
[quoted text clipped - 13 lines]
>
>  
KarenY - 17 Nov 2005 17:30 GMT
Hi Ofer, I am glad it's you again.
Where did you mean to create 2 combo's in one field of the table or 2
separate fields ?
please explain how you mean...sorry
Karen

> Hi Karen
>
[quoted text clipped - 26 lines]
> >
> >  
Ofer - 17 Nov 2005 19:01 GMT
I assume you want to use this combo as a filter for a query.

So to avoid ay extra programming I think the best thing will be to create
two combo's on the form,
=============================
combo1 return a dateStr
Select dateStr,dateNum From TableName

On the after update event of the combo write
Me.Combo2= Me.Combo1.Column(1)
====================================
combo2 return a dateNum
Select dateNum,dateStr From TableName

On the after update event of the combo write
Me.Combo1= Me.Combo2.Column(1)
====================================
So the user can select the any combo, str or number

The query can filter  on of them, because they will both show the same month
Select * From TableName Where DateStr = Forms![FormName]![Combo1]

I hope I make sense
Signature

I hope that helped
Good Luck

> Hi Ofer, I am glad it's you again.
> Where did you mean to create 2 combo's in one field of the table or 2
[quoted text clipped - 32 lines]
> > >
> > >  
KarenY - 17 Nov 2005 21:15 GMT
Brilliant!  Thanks again.

Karen

> I assume you want to use this combo as a filter for a query.
>
[quoted text clipped - 56 lines]
> > > >
> > > >  
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.