expression either by month number or mmm?

G

Guest

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
 
G

Guest

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
 
G

Guest

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

Ofer said:
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


--
I hope that helped
Good Luck


KarenY said:
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
 
G

Guest

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
--
I hope that helped
Good Luck


KarenY said:
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

Ofer said:
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


--
I hope that helped
Good Luck


KarenY said:
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
 
G

Guest

Brilliant! Thanks again.

Karen

Ofer said:
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
--
I hope that helped
Good Luck


KarenY said:
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

Ofer said:
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


--
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
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
 

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